Skip to content
Snippets Groups Projects
Commit b6d34c08 authored by Arvid Ephraim Picciani's avatar Arvid Ephraim Picciani
Browse files

Open context menu for MainWindow

Task-Number: QTCREATORBUG-2406
Reviewed-by: hjk
parent 5a234d01
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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);
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment