diff -Naur qt-x11-opensource-src-4.5.0-beta1-orig/src/qt3support/widgets/q3mainwindow.cpp qt-x11-opensource-src-4.5.0-beta1/src/qt3support/widgets/q3mainwindow.cpp --- qt-x11-opensource-src-4.5.0-beta1-orig/src/qt3support/widgets/q3mainwindow.cpp 2008-12-17 20:16:42.000000000 +0300 +++ qt-x11-opensource-src-4.5.0-beta1/src/qt3support/widgets/q3mainwindow.cpp 2009-01-03 18:01:28.000000000 +0300 @@ -702,6 +702,9 @@ d->rightDock = new Q3DockArea(Qt::Vertical, Q3DockArea::Reverse, this, "qt_right_dock"); d->rightDock->installEventFilter(this); d->hideDock = new QHideDock(this); +#ifndef QT_NO_MENUBAR + createMenuBarAction(); +#endif // QT_NO_MENUBAR } @@ -2414,6 +2417,33 @@ QT_END_NAMESPACE +#ifndef QT_NO_MENUBAR +void Q3MainWindow::createMenuBarAction() +{ + QList vShortcuts; + vShortcuts.append(QKeySequence(Qt::SHIFT | Qt::Key_F10)); + vShortcuts.append(QKeySequence(Qt::CTRL | Qt::Key_Super_L)); + vShortcuts.append(QKeySequence(Qt::CTRL | Qt::Key_Super_R)); + + QAction *vpAction = new QAction(this); + vpAction->setShortcuts(vShortcuts); + connect(vpAction, SIGNAL(triggered()), this, SLOT(activateMenuBar())); + addAction(vpAction); +} + +void Q3MainWindow::activateMenuBar() +{ + QMenuBar *vpMenuBar = menuBar(); + if(!vpMenuBar) return; + if(vpMenuBar->actions().count()<=0) return; + + QAction *vpAction = vpMenuBar->actions().at(0); + if(!vpAction) return; + vpMenuBar->setActiveAction(vpAction); +} +#endif // QT_NO_MENUBAR + + #include "q3mainwindow.moc" #endif diff -Naur qt-x11-opensource-src-4.5.0-beta1-orig/src/qt3support/widgets/q3mainwindow.h qt-x11-opensource-src-4.5.0-beta1/src/qt3support/widgets/q3mainwindow.h --- qt-x11-opensource-src-4.5.0-beta1-orig/src/qt3support/widgets/q3mainwindow.h 2008-12-17 20:16:42.000000000 +0300 +++ qt-x11-opensource-src-4.5.0-beta1/src/qt3support/widgets/q3mainwindow.h 2009-01-03 18:01:28.000000000 +0300 @@ -180,6 +180,14 @@ void childEvent(QChildEvent *); bool event(QEvent *); +#ifndef QT_NO_MENUBAR +protected: + void createMenuBarAction(); + +protected Q_SLOTS: + void activateMenuBar(); +#endif + private Q_SLOTS: void slotPlaceChanged(); void doLineUp() { lineUpDockWindows(true); }