@@ -91,17 +91,6 @@ struct FloatingDockContainerPrivate
91
91
{
92
92
DraggingState = StateId;
93
93
}
94
-
95
- /* *
96
- * Disables the window close button if the content is not closable
97
- */
98
- void disableCloseButton ()
99
- {
100
- auto Flags = _this->windowFlags ();
101
- Flags |= Qt::CustomizeWindowHint;
102
- Flags &= ~Qt::WindowCloseButtonHint;
103
- _this->setWindowFlags (Flags);
104
- }
105
94
};
106
95
// struct FloatingDockContainerPrivate
107
96
@@ -261,10 +250,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockAreaWidget* DockArea) :
261
250
CFloatingDockContainer (DockArea->dockManager ())
262
251
{
263
252
d->DockContainer ->addDockArea (DockArea);
264
- if (!DockArea->features ().testFlag (CDockWidget::DockWidgetClosable))
265
- {
266
- d->disableCloseButton ();
267
- }
268
253
}
269
254
270
255
@@ -273,10 +258,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget* DockWidget) :
273
258
CFloatingDockContainer(DockWidget->dockManager ())
274
259
{
275
260
d->DockContainer ->addDockWidget (CenterDockWidgetArea, DockWidget);
276
- if (!DockWidget->features ().testFlag (CDockWidget::DockWidgetClosable))
277
- {
278
- d->disableCloseButton ();
279
- }
280
261
}
281
262
282
263
// ============================================================================
@@ -499,9 +480,9 @@ bool CFloatingDockContainer::isClosable() const
499
480
void CFloatingDockContainer::onDockAreasAddedOrRemoved ()
500
481
{
501
482
qDebug () << " CFloatingDockContainer::onDockAreasAddedOrRemoved()" ;
502
- if (d->DockContainer ->dockAreaCount () == 1 )
483
+ if (d->DockContainer ->visibleDockAreaCount () == 1 )
503
484
{
504
- d->SingleDockArea = d-> DockContainer -> dockArea ( 0 );
485
+ d->SingleDockArea = topLevelDockWidget ()-> dockAreaWidget ( );
505
486
this ->setWindowTitle (d->SingleDockArea ->currentDockWidget ()->windowTitle ());
506
487
connect (d->SingleDockArea , SIGNAL (currentChanged (int )), this ,
507
488
SLOT (onDockAreaCurrentChanged (int )));
@@ -534,10 +515,6 @@ bool CFloatingDockContainer::restoreState(QXmlStreamReader& Stream, bool Testing
534
515
{
535
516
return false ;
536
517
}
537
- if (!d->DockContainer ->features ().testFlag (CDockWidget::DockWidgetClosable))
538
- {
539
- d->disableCloseButton ();
540
- }
541
518
onDockAreasAddedOrRemoved ();
542
519
return true ;
543
520
}
0 commit comments