diff options
-rw-r--r-- | src/qtmenuitem.cpp | 11 | ||||
-rw-r--r-- | src/qtmenuitem.h | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/qtmenuitem.cpp b/src/qtmenuitem.cpp index 34be067e5..0ee7afd16 100644 --- a/src/qtmenuitem.cpp +++ b/src/qtmenuitem.cpp @@ -88,6 +88,7 @@ QtMenuItem::QtMenuItem(QObject *parent) { connect(_action, SIGNAL(triggered()), this, SIGNAL(triggered())); connect(_action, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); + connect(_action, SIGNAL(changed()), this, SIGNAL(enabledChanged())); } QtMenuItem::~QtMenuItem() @@ -116,6 +117,11 @@ void QtMenuItem::setChecked(bool checked) _action->setChecked(checked); } +void QtMenuItem::setEnabled(bool enabled) +{ + _action->setEnabled(enabled); +} + QString QtMenuItem::text() const { return _action->text(); @@ -136,6 +142,11 @@ bool QtMenuItem::checked() const return _action->isChecked(); } +bool QtMenuItem::enabled() const +{ + return _action->isEnabled(); +} + QAction * QtMenuItem::action() { return _action; diff --git a/src/qtmenuitem.h b/src/qtmenuitem.h index 7fff9e590..d94a1cbb4 100644 --- a/src/qtmenuitem.h +++ b/src/qtmenuitem.h @@ -87,6 +87,7 @@ class QtMenuItem: public QtMenuBase Q_PROPERTY(QString shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged) Q_PROPERTY(bool checkable READ checkable WRITE setCheckable) Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY toggled) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) public: QtMenuItem(QObject *parent = 0); @@ -96,11 +97,13 @@ public: void setShortcut(const QString &shortcut); void setCheckable(bool checkable); void setChecked(bool checked); + void setEnabled(bool enabled); QString text() const; QString shortcut() const; bool checkable() const; bool checked() const; + bool enabled() const; QAction* action(); @@ -109,6 +112,7 @@ Q_SIGNALS: void textChanged(); void shortcutChanged(); void toggled(bool); + void enabledChanged(); private: QAction *_action; |