Commit 757153fc authored by hjk's avatar hjk

ProjectExplorer: Don't show context menu when it makes no sense

Task-number: QTCREATORBUG-17152
Change-Id: Ic67386bdfd6d6d79e8a15bc6394a22cb46305335
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 745fc302
......@@ -518,6 +518,9 @@ public:
ProjectWindow::ProjectWindow()
{
setBackgroundRole(QPalette::Base);
// Request custom context menu but do not provide any to avoid
// the creation of the dock window selection menu.
setContextMenuPolicy(Qt::CustomContextMenu);
auto selectorModel = new SelectorModel(this, [this](QWidget *panel) { setPanel(panel); });
......@@ -553,15 +556,6 @@ ProjectWindow::ProjectWindow()
auto selectorDock = addDockForWidget(selectorView, true);
addDockWidget(Qt::LeftDockWidgetArea, selectorDock);
connect(this, &QWidget::customContextMenuRequested,
selectorModel, &SelectorModel::openContextMenu);
}
void ProjectWindow::contextMenuEvent(QContextMenuEvent *event)
{
Q_UNUSED(event)
// Do nothing to avoid creation of the dock window selection menu.
}
void ProjectWindow::setPanel(QWidget *panel)
......
......@@ -56,7 +56,6 @@ public:
ProjectWindow();
private:
void contextMenuEvent(QContextMenuEvent *event) override;
void setPanel(QWidget *panel);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment