diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 60d2ec9fa..22af49c62 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -292,6 +292,11 @@ bool PushButton::isChecked() const return nativeWidget()->isChecked(); } +bool PushButton::isDown() const +{ + return nativeWidget()->isDown(); +} + KPushButton *PushButton::nativeWidget() const { return static_cast<KPushButton*>(widget()); diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index bcc7aeb46..95141701a 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -49,6 +49,8 @@ class PLASMA_EXPORT PushButton : public QGraphicsProxyWidget Q_PROPERTY(KPushButton *nativeWidget READ nativeWidget) Q_PROPERTY(QAction *action READ action WRITE setAction) Q_PROPERTY(QIcon icon READ icon WRITE setIcon) + Q_PROPERTY(bool checked READ isChecked WRITE setChecked); + Q_PROPERTY(bool down READ isDown); public: explicit PushButton(QGraphicsWidget *parent = 0); @@ -163,6 +165,12 @@ public: */ bool isChecked() const; + /** + * @return true if the button is pressed down + * @since 4.4 + */ + bool isDown() const; + /** * @return the native widget wrapped by this PushButton */