diff --git a/examples/centralwidget/mainwindow.cpp b/examples/centralwidget/mainwindow.cpp index c5d49b5..1889b4c 100644 --- a/examples/centralwidget/mainwindow.cpp +++ b/examples/centralwidget/mainwindow.cpp @@ -49,12 +49,13 @@ CMainWindow::CMainWindow(QWidget *parent) DockManager = new CDockManager(this); // Set central widget - QPlainTextEdit* w = new QPlainTextEdit(); - w->setPlaceholderText("This is the central editor. Enter your text here."); + //QPlainTextEdit* w = new QPlainTextEdit(); + //w->setPlaceholderText("This is the central editor. Enter your text here."); CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget"); - CentralDockWidget->setWidget(w); + //CentralDockWidget->setWidget(w); auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget); - CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas); + CentralDockWidget->setFeature(ads::CDockWidget::NoTab, true); + //CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas); // create other dock widgets QTreeView* fileTree = new QTreeView(); diff --git a/src/DockWidget.h b/src/DockWidget.h index 712023f..ed1a3d2 100644 --- a/src/DockWidget.h +++ b/src/DockWidget.h @@ -154,6 +154,7 @@ public: CustomCloseHandling = 0x10, ///< clicking the close button will not close the dock widget but emits the closeRequested() signal instead DockWidgetFocusable = 0x20, ///< if this is enabled, a dock widget can get focus highlighting DockWidgetForceCloseWithArea = 0x40, ///< dock widget will be closed when the dock area hosting it is closed + NoTab = 0x80, ///< dock widget tab will never be shown if this flag is set DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable, AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling, DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose, diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp index ca299fe..f72d1ff 100644 --- a/src/DockWidgetTab.cpp +++ b/src/DockWidgetTab.cpp @@ -629,7 +629,7 @@ void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event) //============================================================================ void CDockWidgetTab::setVisible(bool visible) { - // Just here for debugging to insert debug output + visible &= !d->DockWidget->features().testFlag(CDockWidget::NoTab); Super::setVisible(visible); }