mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-12 16:20:25 +08:00
Added new CDockWidget flag CDockWidget::NoTab to hide the tab from the dock area title bar
This commit is contained in:
parent
c8fe4c46dd
commit
8a27a5596b
@ -49,12 +49,13 @@ CMainWindow::CMainWindow(QWidget *parent)
|
|||||||
DockManager = new CDockManager(this);
|
DockManager = new CDockManager(this);
|
||||||
|
|
||||||
// Set central widget
|
// Set central widget
|
||||||
QPlainTextEdit* w = new QPlainTextEdit();
|
//QPlainTextEdit* w = new QPlainTextEdit();
|
||||||
w->setPlaceholderText("This is the central editor. Enter your text here.");
|
//w->setPlaceholderText("This is the central editor. Enter your text here.");
|
||||||
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
|
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
|
||||||
CentralDockWidget->setWidget(w);
|
//CentralDockWidget->setWidget(w);
|
||||||
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
|
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
|
||||||
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
|
CentralDockWidget->setFeature(ads::CDockWidget::NoTab, true);
|
||||||
|
//CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
|
||||||
|
|
||||||
// create other dock widgets
|
// create other dock widgets
|
||||||
QTreeView* fileTree = new QTreeView();
|
QTreeView* fileTree = new QTreeView();
|
||||||
|
@ -154,6 +154,7 @@ public:
|
|||||||
CustomCloseHandling = 0x10, ///< clicking the close button will not close the dock widget but emits the closeRequested() signal instead
|
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
|
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
|
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,
|
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable,
|
||||||
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling,
|
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling,
|
||||||
DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose,
|
DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose,
|
||||||
|
@ -629,7 +629,7 @@ void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event)
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockWidgetTab::setVisible(bool visible)
|
void CDockWidgetTab::setVisible(bool visible)
|
||||||
{
|
{
|
||||||
// Just here for debugging to insert debug output
|
visible &= !d->DockWidget->features().testFlag(CDockWidget::NoTab);
|
||||||
Super::setVisible(visible);
|
Super::setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user