diff options
author | Nick Dedekind <nick.dedekind@canonical.com> | 2015-09-08 12:38:18 +0100 |
---|---|---|
committer | Nick Dedekind <nick.dedekind@canonical.com> | 2015-09-08 12:38:18 +0100 |
commit | 523db871138277062675db9108cbcb3ca61da5e1 (patch) | |
tree | 9a5910fe9cf61e9ab7001ce76130f559a7145b93 /libqmenumodel/src | |
parent | e6e4babce2ed63c327f85180d77e24dc6a330c11 (diff) | |
download | qmenumodel-523db871138277062675db9108cbcb3ca61da5e1.tar.gz qmenumodel-523db871138277062675db9108cbcb3ca61da5e1.tar.bz2 qmenumodel-523db871138277062675db9108cbcb3ca61da5e1.zip |
accelerators
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r-- | libqmenumodel/src/unitymenumodel.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index 63d5e5b..56d73c6 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -50,7 +50,9 @@ enum MenuRoles { ActionStateRole, IsCheckRole, IsRadioRole, - IsToggledRole + IsToggledRole, + KeySequence, + HasSubmenu }; class UnityMenuModelPrivate @@ -482,6 +484,12 @@ QVariant UnityMenuModel::data(const QModelIndex &index, int role) const case IsToggledRole: return gtk_menu_tracker_item_get_toggled (item) == TRUE ? true : false; + case KeySequence: + return QKeySequence(gtk_menu_tracker_item_get_accel (item), QKeySequence::NativeText); + + case HasSubmenu: + return gtk_menu_tracker_item_get_has_submenu (item) == TRUE ? true : false; + default: return QVariant(); } @@ -513,6 +521,8 @@ QHash<int, QByteArray> UnityMenuModel::roleNames() const names[IsCheckRole] = "isCheck"; names[IsRadioRole] = "isRadio"; names[IsToggledRole] = "isToggled"; + names[KeySequence] = "keySequence"; + names[HasSubmenu] = "hasSubmenu"; return names; } |