From 5b12c8736b93c288343d5dbecda7af8fdf264b3e Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Sun, 20 Sep 2009 17:41:42 +0200 Subject: Introduce MenuSoftKey as a standard key to the internal enum. QMainWindow was using the 'Done' standard softkey to represent the action for the menu bar, but that was obviously wrong and pointed out that one of hte needed standard softkeys was needed. Reviewed-by: Alessandro Portale --- src/gui/kernel/qsoftkeymanager.cpp | 4 ++++ src/gui/kernel/qsoftkeymanager_p.h | 1 + src/gui/widgets/qmainwindow.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 64cffe0..ed6f4c9 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -82,6 +82,9 @@ const char *QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) case DoneSoftKey: softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Done"); break; + case MenuSoftKey: + softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Options"); + break; case CancelSoftKey: softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Cancel"); break; @@ -113,6 +116,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act case OkSoftKey: case SelectSoftKey: case DoneSoftKey: + case MenuSoftKey: softKeyRole = QAction::PositiveSoftKey; break; case CancelSoftKey: diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h index 1bc6908..c4bb84d 100644 --- a/src/gui/kernel/qsoftkeymanager_p.h +++ b/src/gui/kernel/qsoftkeymanager_p.h @@ -73,6 +73,7 @@ public: OkSoftKey, SelectSoftKey, DoneSoftKey, + MenuSoftKey, CancelSoftKey, }; diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 8bdbba7..227a179 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -118,7 +118,7 @@ void QMainWindowPrivate::init() iconSize = QSize(metric, metric); q->setAttribute(Qt::WA_Hover); #ifdef QT_SOFTKEYS_ENABLED - menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::DoneSoftKey, q); + menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q); #endif } -- cgit v0.12