diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 1791b6247..fec51948c 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -281,6 +281,11 @@ void PushButton::setCheckable(bool checkable) nativeWidget()->setCheckable(checkable); } +bool PushButton::isCheckable() const +{ + return nativeWidget()->isCheckable(); +} + void PushButton::setChecked(bool checked) { nativeWidget()->setChecked(checked); diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 672f8bc0d..214edb6d1 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -49,6 +49,7 @@ 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 checkable READ isCheckable WRITE setCheckable) Q_PROPERTY(bool checked READ isChecked WRITE setChecked) Q_PROPERTY(bool down READ isDown) @@ -150,6 +151,13 @@ public: */ void setCheckable(bool checkable); + /** + * @return true if the button is checkable + * @see setCheckable + * @since 4.4 + */ + bool isCheckable() const; + /** * Sets whether or not this button is checked. Implies setIsCheckable(true). *