diff options
-rw-r--r-- | src/libs/utils/fancymainwindow.cpp | 8 | ||||
-rw-r--r-- | src/libs/utils/fancymainwindow.h | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debuggermainwindow.cpp | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index 2bb28ff7b1..7544c35d5d 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -33,6 +33,7 @@ #include <QtCore/QHash> #include <QtGui/QAction> +#include <QtGui/QContextMenuEvent> #include <QtGui/QMenu> #include <QtGui/QDockWidget> #include <QtCore/QSettings> @@ -179,6 +180,13 @@ void FancyMainWindow::showEvent(QShowEvent *event) handleVisibilityChanged(true); } +void FancyMainWindow::contextMenuEvent(QContextMenuEvent *event) +{ + QMenu *menu = createPopupMenu(); + menu->exec(event->globalPos()); + delete menu; +} + void FancyMainWindow::handleVisibilityChanged(bool visible) { d->m_handleDockVisibilityChanges = false; diff --git a/src/libs/utils/fancymainwindow.h b/src/libs/utils/fancymainwindow.h index 2b0927a058..7ffeb23da9 100644 --- a/src/libs/utils/fancymainwindow.h +++ b/src/libs/utils/fancymainwindow.h @@ -92,7 +92,7 @@ public slots: protected: void hideEvent(QHideEvent *event); void showEvent(QShowEvent *event); - + void contextMenuEvent(QContextMenuEvent *event); private slots: void onDockActionTriggered(); void onDockVisibilityChange(bool); diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 720ba2b1dd..167e02bd38 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -67,7 +67,7 @@ QMenu* DebuggerMainWindow::createPopupMenu() const QList<QDockWidget* > dockwidgets = m_uiSwitcher->i_mw_dockWidgets(); if (!dockwidgets.isEmpty()) { - menu = new QMenu(this); + menu = FancyMainWindow::createPopupMenu(); foreach (QDockWidget *dockWidget, dockwidgets) { if (dockWidget->parentWidget() == this) |