diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-07-17 11:36:08 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-07-17 13:24:22 (GMT) |
commit | 5f6c0594f07df57af2574be0420a68f84b703b87 (patch) | |
tree | 77fadf5fe3fb6de31224cc0c351005eec0750398 /src/gui/kernel/qaction.h | |
parent | 080231536cbc5e9acc486e57e165320416f66d85 (diff) | |
download | Qt-5f6c0594f07df57af2574be0420a68f84b703b87.zip Qt-5f6c0594f07df57af2574be0420a68f84b703b87.tar.gz Qt-5f6c0594f07df57af2574be0420a68f84b703b87.tar.bz2 |
Add priority property to QAction
We need this to support the behavior in Gtk+ where, when
Qt::ToolButtonTextBesideIcon is used, only text labels
for important actions are shown. It will also enable us to
prioritize actions in the future when for instance collapsing
a toolbar.
Task-number: 258290
Reviewed-by: thierry
Diffstat (limited to 'src/gui/kernel/qaction.h')
-rw-r--r-- | src/gui/kernel/qaction.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index 6920ec5..133fab4 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -67,6 +67,7 @@ class Q_GUI_EXPORT QAction : public QObject Q_DECLARE_PRIVATE(QAction) Q_ENUMS(MenuRole) + Q_ENUMS(Priority) Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) @@ -85,10 +86,14 @@ class Q_GUI_EXPORT QAction : public QObject Q_PROPERTY(bool visible READ isVisible WRITE setVisible) Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole) Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu) + Q_PROPERTY(Priority priority READ priority WRITE setPriority) public: enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, AboutRole, PreferencesRole, QuitRole }; + enum Priority { LowPriority = 0, + NormalPriority = 128, + HighPriority = 256}; explicit QAction(QObject* parent); QAction(const QString &text, QObject* parent); QAction(const QIcon &icon, const QString &text, QObject* parent); @@ -123,6 +128,9 @@ public: void setWhatsThis(const QString &what); QString whatsThis() const; + void setPriority(Priority priority); + Priority priority() const; + #ifndef QT_NO_MENU QMenu *menu() const; void setMenu(QMenu *menu); |