Plasma
toolbutton.cpp
Go to the documentation of this file.
349 if (button->isEnabled() && (animationState || !button->autoRaise() || d->underMouse || (buttonOpt.state & QStyle::State_On) || button->isChecked() || button->isDown())) {
369 buttonOpt.palette.setColor(QPalette::ButtonText, KColorUtils::mix(Plasma::Theme::defaultTheme()->color(Plasma::Theme::ButtonTextColor), Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor), 1-d->opacity));
372 buttonOpt.palette.setColor(QPalette::ButtonText, Plasma::Theme::defaultTheme()->color(Plasma::Theme::ButtonTextColor));
376 buttonOpt.palette.setColor(QPalette::ButtonText, Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
virtual void updateGeometry()
QString image() 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 setDown(bool)
void setText(const QString &text)
Sets the display text for this ToolButton.
Definition: toolbutton.cpp:221
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Definition: toolbutton.cpp:439
void setStyleSheet(const QString &styleSheet)
QSize size() const
QToolButton * nativeWidget() const
void resizeEvent(QGraphicsSceneResizeEvent *event)
Definition: toolbutton.cpp:306
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Definition: toolbutton.cpp:385
Type type() const
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
int width() const
bool end()
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setCompositionMode(CompositionMode mode)
void setAction(QAction *action)
Associate an action with this IconWidget this makes the button follow the state of the action...
Definition: toolbutton.cpp:201
void resize(const QSize &size)
bool autoRaise() const
QAction * action() const
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: toolbutton.cpp:329
QStyle * style() const
void setAcceptHoverEvents(bool enabled)
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
void setAttribute(Qt::WidgetAttribute attribute, bool on)
the text color to be used by items resting on the background
Definition: theme.h:63
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
Definition: toolbutton.cpp:450
void setIcon(const QIcon &icon)
void adjust(qreal dx1, qreal dy1, qreal dx2, qreal dy2)
void setWindowIcon(const QIcon &icon)
void initFrom(const QWidget *widget)
QSizeF size() const
QScriptValue animation(const QString &anim)
Definition: animationscriptengine.cpp:55
QFont font() const
virtual void resizeEvent(QGraphicsSceneResizeEvent *event)
void setFont(const QFont &font)
virtual void changeEvent(QEvent *event)
bool isEnabled() const
void setStyleSheet(const QString &stylesheet)
Sets the stylesheet used to control the visual display of this ToolButton.
Definition: toolbutton.cpp:291
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void released()
iconSize
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
void setAutoRaise(bool enable)
void setAutoRaise(bool raise)
Sets if the toolbutton has an autoraise behaviour.
Definition: toolbutton.cpp:211
Definition: theme.h:67
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Definition: toolbutton.cpp:406
void setImage(const QString &path)
Sets the path to an image to display.
Definition: toolbutton.cpp:232
bool isRelativePath(const QString &path)
bool isChecked() const
bool isEnabled() const
virtual void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
QWidget * widget() const
void setAlphaF(qreal alpha)
void setWidget(QWidget *widget)
void pressed()
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void clicked()
qreal height() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
toolButtonStyle
QString styleSheet()
QRect rect() const
QString text() const
qreal width() 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.