From 1730d86a73a51b32e322da5e4729644ba935816e Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 13 Sep 2009 18:12:32 +0000 Subject: [PATCH] add some properties and isDown() svn path=/trunk/KDE/kdelibs/; revision=1023016 --- widgets/pushbutton.cpp | 5 +++++ widgets/pushbutton.h | 8 ++++++++ 2 files changed, 13 insertions(+) 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(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 */