diff options
author | Janne Anttila <janne.anttila@digia.com> | 2010-03-12 11:32:38 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2010-03-12 11:36:11 (GMT) |
commit | 7829fe1507741c7196fe3904d90ea10178625393 (patch) | |
tree | 2062721f23dc7e8bb0c9d234058c6bb3602a1855 /src/gui/widgets/qmainwindow.cpp | |
parent | 76c0bc4f95fce3c5fd9f77b778180d1b50b2b095 (diff) | |
download | Qt-7829fe1507741c7196fe3904d90ea10178625393.zip Qt-7829fe1507741c7196fe3904d90ea10178625393.tar.gz Qt-7829fe1507741c7196fe3904d90ea10178625393.tar.bz2 |
Moved softkey "Options" action handling from QMainWindow to QMenuBar.
This change is done to enable QMenuBar usage and related "Options"
softkey also on other than QMainWindow objects. For example with this
change it is possible to create menubar and set it to QLayout by using
setMenuBar, and it will then be usable via "Options" softkey.
This functionality makes it easy to use different menus for different
views in QStackedWidget.
Task-number: QT-2275 (Not yet finished, but related)
Reviewed-by: Sami Merila
Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/widgets/qmainwindow.cpp')
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 7e59bb0..16a7c31 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -65,9 +65,6 @@ QT_BEGIN_NAMESPACE extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp QT_END_NAMESPACE #endif -#ifdef QT_SOFTKEYS_ENABLED -#include <private/qsoftkeymanager_p.h> -#endif QT_BEGIN_NAMESPACE @@ -80,9 +77,6 @@ public: #ifdef Q_WS_MAC , useHIToolBar(false) #endif -#ifdef QT_SOFTKEYS_ENABLED - , menuBarAction(0) -#endif #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) , hasOldCursor(false) , cursorAdjusted(false) #endif @@ -94,9 +88,6 @@ public: #ifdef Q_WS_MAC bool useHIToolBar; #endif -#ifdef QT_SOFTKEYS_ENABLED - QAction *menuBarAction; -#endif void init(); QList<int> hoverSeparator; QPoint hoverPos; @@ -117,10 +108,6 @@ void QMainWindowPrivate::init() const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize, 0, q); iconSize = QSize(metric, metric); q->setAttribute(Qt::WA_Hover); -#ifdef QT_SOFTKEYS_ENABLED - menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q); - menuBarAction->setVisible(false); -#endif } /* @@ -492,13 +479,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->deleteLater(); } d->layout->setMenuBar(menuBar); - -#ifdef QT_SOFTKEYS_ENABLED - if (menuBar) - addAction(d->menuBarAction); - else - removeAction(d->menuBarAction); -#endif } /*! @@ -1427,11 +1407,6 @@ bool QMainWindow::event(QEvent *event) } break; #endif -#ifdef QT_SOFTKEYS_ENABLED - case QEvent::LanguageChange: - d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey)); - break; -#endif default: break; } |