Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37760197
en ru br
ALT Linux repos
S:4.8.7-alt25
5.0: 4.5.2-alt1.M50.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

Group :: System/Libraries
RPM: qt4

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 9105-qt-qt3support-menubar_activate.patch
Download


diff -Naur qt.orig/src/qt3support/widgets/q3mainwindow.cpp qt/src/qt3support/widgets/q3mainwindow.cpp
--- qt.orig/src/qt3support/widgets/q3mainwindow.cpp	2009-06-02 10:45:13.000000000 +0400
+++ qt/src/qt3support/widgets/q3mainwindow.cpp	2009-06-02 11:44:36.000000000 +0400
@@ -707,6 +707,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
 }
 
 
@@ -2422,6 +2425,33 @@
 
 QT_END_NAMESPACE
 
+#ifndef QT_NO_MENUBAR
+void Q3MainWindow::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 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.orig/src/qt3support/widgets/q3mainwindow.h qt/src/qt3support/widgets/q3mainwindow.h
--- qt.orig/src/qt3support/widgets/q3mainwindow.h	2009-05-12 19:29:29.000000000 +0400
+++ qt/src/qt3support/widgets/q3mainwindow.h	2009-06-02 11:44:36.000000000 +0400
@@ -185,6 +185,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); }
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin