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()
466
466
Action = ui.menuTests ->addAction (QString (" Raise %1" ).arg (DockWidget->windowTitle ()));
467
467
DockWidget->connect (Action, SIGNAL (triggered ()), SLOT (raise ()));
468
468
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
+
469
478
470
479
#ifdef Q_OS_WIN
471
480
#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
1625
1625
}
1626
1626
1627
1627
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
+
1628
1643
// ============================================================================
1629
1644
void CDockContainerWidget::saveState (QXmlStreamWriter& s) const
1630
1645
{
Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ class ADS_EXPORT CDockContainerWidget : public QFrame
216
216
*/
217
217
QList<CDockAreaWidget*> openedDockAreas () const ;
218
218
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
+
219
226
/* *
220
227
* This function returns true if this dock area has only one single
221
228
* visible dock widget.
Original file line number Diff line number Diff line change @@ -762,7 +762,12 @@ void CDockManager::showEvent(QShowEvent *event)
762
762
763
763
for (auto FloatingWidget : d->UninitializedFloatingWidgets )
764
764
{
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
+ }
766
771
}
767
772
d->UninitializedFloatingWidgets .clear ();
768
773
}
You can’t perform that action at this time.
0 commit comments