Репозитории ALT
S: | 4.8.7-alt25 |
5.1: | 4.6.3-alt1.M51.1 |
4.1: | 4.4.3-alt1.M41.1 |
4.0: | 4.3.4-alt5.M40.1 |
3.0: | 4.0.1-alt1 |
+updates: | 4.0.1-alt2 |
+backports: | 4.2.3-alt7.1.M30 |
Группа :: Система/Библиотеки
Пакет: qt4
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: 9102-qt-gui-menubar_activate.patch
Скачать
Скачать
diff -Naur qt-orig/src/gui/widgets/qmainwindow.cpp qt/src/gui/widgets/qmainwindow.cpp
--- qt-orig/src/gui/widgets/qmainwindow.cpp 2010-04-05 07:46:28 +0400
+++ qt/src/gui/widgets/qmainwindow.cpp 2010-05-10 10:01:08 +0400
@@ -306,6 +306,9 @@
: QWidget(*(new QMainWindowPrivate()), parent, flags | Qt::Window)
{
d_func()->init();
+#ifndef QT_NO_MENUBAR
+ createMenuBarAction();
+#endif // QT_NO_MENUBAR
}
#ifdef QT3_SUPPORT
@@ -319,6 +322,9 @@
{
setObjectName(QString::fromAscii(name));
d_func()->init();
+#ifndef QT_NO_MENUBAR
+ createMenuBarAction();
+#endif // QT_NO_MENUBAR
}
#endif
@@ -1609,4 +1615,30 @@
QT_END_NAMESPACE
+#ifndef QT_NO_MENUBAR
+void QMainWindow::createMenuBarAction()
+{
+ QList<QKeySequence> 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 QMainWindow::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
+
#endif // QT_NO_MAINWINDOW
diff -Naur qt-orig/src/gui/widgets/qmainwindow.h qt/src/gui/widgets/qmainwindow.h
--- qt-orig/src/gui/widgets/qmainwindow.h 2010-01-24 11:45:55 +0300
+++ qt/src/gui/widgets/qmainwindow.h 2010-05-10 10:01:08 +0400
@@ -203,6 +203,14 @@
#endif
bool event(QEvent *event);
+#ifndef QT_NO_MENUBAR
+protected:
+ void createMenuBarAction();
+
+protected Q_SLOTS:
+ void activateMenuBar();
+#endif
+
private:
Q_DECLARE_PRIVATE(QMainWindow)
Q_DISABLE_COPY(QMainWindow)