From 6eb497fb64714ff99e92c7b6b8afbb47f3b809ae Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Thu, 3 Sep 2020 15:22:43 +0200 Subject: [PATCH] Added test for dock manager flag EqualSplitOnInsertion to demo aplication --- demo/MainWindow.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index 5127242..2dbdc59 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -166,6 +166,7 @@ struct MainWindowPrivate QComboBox* PerspectiveComboBox = nullptr; ads::CDockManager* DockManager = nullptr; ads::CDockWidget* WindowTitleTestDockWidget = nullptr; + ads::CDockWidget* LastDockedEditor = nullptr; MainWindowPrivate(CMainWindow* _public) : _this(_public) {} @@ -720,7 +721,17 @@ void CMainWindow::createEditor() } else { - d->DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget); + ads::CDockAreaWidget* EditorArea = d->LastDockedEditor ? d->LastDockedEditor->dockAreaWidget() : nullptr; + if (EditorArea) + { + d->DockManager->setConfigFlag(ads::CDockManager::EqualSplitOnInsertion, true); + d->DockManager->addDockWidget(ads::RightDockWidgetArea, DockWidget, EditorArea); + } + else + { + d->DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget); + } + d->LastDockedEditor = DockWidget; } }