Plasma
pushbutton.cpp
Go to the documentation of this file.
88 float scale = q->nativeWidget()->iconSize().width() / qMax(elementSize.width(), elementSize.height());
386 if (!nativeWidget()->isDown() && !nativeWidget()->isChecked() && isEnabled() && acceptHoverEvents() && d->background->hasElementPrefix("active")) {
387 if (d->hoverAnimation->state() == QAbstractAnimation::Running && !isUnderMouse() && !nativeWidget()->isDefault()) {
418 pixmapRect = nativeWidget()->style()->alignedRect(option->direction, Qt::AlignCenter, iconPix.size(), rect.toRect());
420 pixmapRect = nativeWidget()->style()->alignedRect(option->direction, Qt::AlignLeft|Qt::AlignVCenter, iconPix.size(), rect.toRect());
530 int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget());
virtual void updateGeometry()
QIcon icon() const
Q_INVOKABLE QString imagePath(const QString &name) const
Retrieve the path for an SVG image in the current theme.
Definition: theme.cpp:794
void setStyleSheet(const QString &styleSheet)
qreal y() const
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
QRect toRect() const
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setCompositionMode(CompositionMode mode)
void resize(const QSize &size)
void fill(const QColor &color)
QString image() const
void setColorAt(qreal position, const QColor &color)
void setAcceptHoverEvents(bool enabled)
QSizeF size() const
void resizeEvent(QGraphicsSceneResizeEvent *event)
Definition: pushbutton.cpp:344
qreal width(const QString &text) const
void adjust(qreal dx1, qreal dy1, qreal dx2, qreal dy2)
QString styleSheet()
void clicked()
Emitted when the button is pressed then released, completing a click.
void setHeight(qreal height)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: pushbutton.cpp:353
void setStyleSheet(const QString &stylesheet)
Sets the stylesheet used to control the visual display of this PushButton.
Definition: pushbutton.cpp:273
void initFrom(const QWidget *widget)
QSizeF size() const
void pressed()
Emitted when the button is pressed down; usually the clicked() signal will suffice, however.
QFont font() const
virtual void resizeEvent(QGraphicsSceneResizeEvent *event)
void setFont(const QFont &font)
virtual void changeEvent(QEvent *event)
bool isEmpty() const
effect
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void setPen(const QColor &color)
QSize toSize() const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
QPointF topLeft() const
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
void setChecked(bool checked)
Sets whether or not this button is checked.
Definition: pushbutton.cpp:319
void drawText(const QPointF &position, const QString &text)
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Definition: pushbutton.cpp:499
void setImage(const QString &path)
Sets the path to an image to display.
Definition: pushbutton.cpp:234
void click()
Performs a visual click and emits the associated signals.
Definition: pushbutton.cpp:324
void setCoordinateMode(CoordinateMode mode)
void setSizePolicy(const QSizePolicy &policy)
Definition: theme.h:67
bool isNull() const
bool isRelativePath(const QString &path)
void setText(const QString &text)
Sets the display text for this PushButton.
Definition: pushbutton.cpp:223
bool isEnabled() const
qreal width() const
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Definition: pushbutton.cpp:474
void released()
Emitted when the button is released; usually the clicked() signal will suffice, however.
QRectF rect() const
static Plasma::Animation * create(Animator::Animation type, QObject *parent=0)
Factory to build new animation objects.
Definition: animator.cpp:61
QPoint topLeft() const
void translate(const QPointF &offset)
QWidget * widget() const
qreal height() const
void setWidget(QWidget *widget)
void setAction(QAction *action)
Associate an action with this IconWidget this makes the button follow the state of the action...
Definition: pushbutton.cpp:284
QRectF contentsRect() const
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
bool isUnderMouse() const
qreal height() const
void moveTop(qreal y)
bool acceptHoverEvents() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
KPushButton * nativeWidget() const
const QPen & pen() const
QRect rect() const
virtual QRectF boundingRect() const
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
Definition: pushbutton.cpp:519
QAction * action() const
qreal width() const
void setCheckable(bool checkable)
Sets whether or not this button can be toggled on/off.
Definition: pushbutton.cpp:309
qreal height() const
QString text() const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.