Revert "QDockWidget: Always show dock widgets with the main window"
This reverts commit 4c60a11d8f935abb762a83b0ab99cefa6db3060c. Reason for revert: Breaks QMainWindow::restoreState(). Dock widget is shown, even if restored into hidden state. Change-Id: I9808de4e0fd48871c3b234ae9bbaf6c64c8e832d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0ea37300d111beea3bb353f036d6c747f63c88dd) Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
parent
fef7baaf11
commit
b01235ca3f
@ -1290,13 +1290,6 @@ bool QMainWindow::event(QEvent *event)
|
||||
return true;
|
||||
#endif // QT_CONFIG(statustip)
|
||||
|
||||
#if QT_CONFIG(dockwidget)
|
||||
case QEvent::Show:
|
||||
Q_ASSERT(d->layout);
|
||||
d->layout->showDockWidgets();
|
||||
break;
|
||||
#endif // QT_CONFIG(dockwidget)
|
||||
|
||||
case QEvent::StyleChange:
|
||||
#if QT_CONFIG(dockwidget)
|
||||
Q_ASSERT(d->layout);
|
||||
|
@ -1630,17 +1630,6 @@ inline static Qt::DockWidgetArea toDockWidgetArea(int pos)
|
||||
return QDockWidgetPrivate::toDockWidgetArea(static_cast<QInternal::DockPosition>(pos));
|
||||
}
|
||||
|
||||
void QMainWindowLayout::showDockWidgets() const
|
||||
{
|
||||
const auto dockWidgets = parent()->findChildren<QDockWidget *>(Qt::FindDirectChildrenOnly);
|
||||
for (auto *dockWidget : dockWidgets)
|
||||
dockWidget->show();
|
||||
|
||||
const auto groupWindows = parent()->findChildren<QDockWidgetGroupWindow *>(Qt::FindDirectChildrenOnly);
|
||||
for (auto *groupWindow : groupWindows)
|
||||
groupWindow->show();
|
||||
}
|
||||
|
||||
// Checks if QDockWidgetGroupWindow or QDockWidget can be plugged the area indicated by path.
|
||||
// Returns false if called with invalid widget type or if compiled without dockwidget support.
|
||||
static bool isAreaAllowed(QWidget *widget, const QList<int> &path)
|
||||
|
@ -508,7 +508,6 @@ public:
|
||||
Qt::Orientation orientation);
|
||||
Qt::DockWidgetArea dockWidgetArea(QWidget* widget) const;
|
||||
bool restoreDockWidget(QDockWidget *dockwidget);
|
||||
void showDockWidgets() const;
|
||||
#if QT_CONFIG(tabbar)
|
||||
void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
|
||||
void raise(QDockWidget *widget);
|
||||
|
Loading…
x
Reference in New Issue
Block a user