summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r--src/widgets/widgets/qmainwindow.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 5dfa439b2e..c31e9750bf 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -1729,10 +1729,20 @@ QMenu *QMainWindow::createPopupMenu()
menu = new QMenu(this);
for (int i = 0; i < dockwidgets.size(); ++i) {
QDockWidget *dockWidget = dockwidgets.at(i);
- if (dockWidget->parentWidget() == this
- && !d->layout->layoutState.dockAreaLayout.indexOf(dockWidget).isEmpty()) {
- menu->addAction(dockwidgets.at(i)->toggleViewAction());
+ // filter to find out if we own this QDockWidget
+ if (dockWidget->parentWidget() == this) {
+ if (d->layout->layoutState.dockAreaLayout.indexOf(dockWidget).isEmpty())
+ continue;
+ } else if (QDockWidgetGroupWindow *dwgw =
+ qobject_cast<QDockWidgetGroupWindow *>(dockWidget->parentWidget())) {
+ if (dwgw->parentWidget() != this)
+ continue;
+ if (dwgw->layoutInfo()->indexOf(dockWidget).isEmpty())
+ continue;
+ } else {
+ continue;
}
+ menu->addAction(dockwidgets.at(i)->toggleViewAction());
}
menu->addSeparator();
}