Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37861966
en ru br
Репозитории 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
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: qt4

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: 9102-qt-gui-4.5.0-menubar_activate.patch
Скачать


diff -Naur qt-x11-opensource-src-4.5.0-beta1-orig/src/gui/widgets/qmainwindow.cpp qt-x11-opensource-src-4.5.0-beta1/src/gui/widgets/qmainwindow.cpp
--- qt-x11-opensource-src-4.5.0-beta1-orig/src/gui/widgets/qmainwindow.cpp	2008-12-17 20:16:41.000000000 +0300
+++ qt-x11-opensource-src-4.5.0-beta1/src/gui/widgets/qmainwindow.cpp	2009-01-03 17:54:32.000000000 +0300
@@ -300,6 +300,9 @@
     : QWidget(*(new QMainWindowPrivate()), parent, flags | Qt::Window)
 {
     d_func()->init();
+#ifndef QT_NO_MENUBAR
+    createMenuBarAction();
+#endif // QT_NO_MENUBAR
 }
 
 #ifdef QT3_SUPPORT
@@ -313,6 +316,9 @@
 {
     setObjectName(QString::fromAscii(name));
     d_func()->init();
+#ifndef QT_NO_MENUBAR
+    createMenuBarAction();
+#endif // QT_NO_MENUBAR
 }
 #endif
 
@@ -1567,4 +1573,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-x11-opensource-src-4.5.0-beta1-orig/src/gui/widgets/qmainwindow.h qt-x11-opensource-src-4.5.0-beta1/src/gui/widgets/qmainwindow.h
--- qt-x11-opensource-src-4.5.0-beta1-orig/src/gui/widgets/qmainwindow.h	2008-12-17 20:16:41.000000000 +0300
+++ qt-x11-opensource-src-4.5.0-beta1/src/gui/widgets/qmainwindow.h	2009-01-03 17:54:32.000000000 +0300
@@ -196,6 +196,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)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin