File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,15 @@ void MainWindowPrivate::createContent()
466466 Action = ui.menuTests ->addAction (QString (" Raise %1" ).arg (DockWidget->windowTitle ()));
467467 DockWidget->connect (Action, SIGNAL (triggered ()), SLOT (raise ()));
468468
469+ // Test hidden floating dock widget
470+ DockWidget = createLongTextLabelDockWidget ();
471+ DockManager->addDockWidgetFloating (DockWidget);
472+ DockWidget->toggleView (false );
473+
474+ // Test visible floating dock widget
475+ DockWidget = createCalendarDockWidget ();
476+ DockManager->addDockWidgetFloating (DockWidget);
477+
469478
470479#ifdef Q_OS_WIN
471480#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
Original file line number Diff line number Diff line change @@ -1625,6 +1625,21 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
16251625}
16261626
16271627
1628+ // ============================================================================
1629+ bool CDockContainerWidget::hasOpenDockAreas () const
1630+ {
1631+ for (auto DockArea : d->DockAreas )
1632+ {
1633+ if (!DockArea->isHidden ())
1634+ {
1635+ return true ;
1636+ }
1637+ }
1638+
1639+ return false ;
1640+ }
1641+
1642+
16281643// ============================================================================
16291644void CDockContainerWidget::saveState (QXmlStreamWriter& s) const
16301645{
Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ class ADS_EXPORT CDockContainerWidget : public QFrame
216216 */
217217 QList<CDockAreaWidget*> openedDockAreas () const ;
218218
219+ /* *
220+ * This function returns true, if the container has open dock areas.
221+ * This functions is a little bit faster than calling openedDockAreas().isEmpty()
222+ * because it returns as soon as it finds an open dock area
223+ */
224+ bool hasOpenDockAreas () const ;
225+
219226 /* *
220227 * This function returns true if this dock area has only one single
221228 * visible dock widget.
Original file line number Diff line number Diff line change @@ -762,7 +762,12 @@ void CDockManager::showEvent(QShowEvent *event)
762762
763763 for (auto FloatingWidget : d->UninitializedFloatingWidgets )
764764 {
765- FloatingWidget->show ();
765+ // Check, if someone closed a floating dock widget before the dock
766+ // manager is shown
767+ if (FloatingWidget->dockContainer ()->hasOpenDockAreas ())
768+ {
769+ FloatingWidget->show ();
770+ }
766771 }
767772 d->UninitializedFloatingWidgets .clear ();
768773}
You can’t perform that action at this time.
0 commit comments