@@ -544,6 +544,14 @@ void MainWindowPrivate::createActions()
544544 _this->connect (a, SIGNAL (triggered ()), SLOT (createEditor ()));
545545 ui.menuTests ->addAction (a);
546546
547+ a = ui.toolBar ->addAction (" Create Editor Tab" );
548+ a->setProperty (" Floating" , false );
549+ a->setToolTip (" Creates a editor tab and inserts it as second tab into an area" );
550+ a->setIcon (svgIcon (" :/adsdemo/images/tab.svg" ));
551+ a->setProperty (" Tabbed" , true );
552+ _this->connect (a, SIGNAL (triggered ()), SLOT (createEditor ()));
553+ ui.menuTests ->addAction (a);
554+
547555 a = ui.toolBar ->addAction (" Create Floating Table" );
548556 a->setToolTip (" Creates floating dynamic dockable table with millions of entries" );
549557 a->setIcon (svgIcon (" :/adsdemo/images/grid_on.svg" ));
@@ -769,6 +777,8 @@ void CMainWindow::createEditor()
769777 QObject* Sender = sender ();
770778 QVariant vFloating = Sender->property (" Floating" );
771779 bool Floating = vFloating.isValid () ? vFloating.toBool () : true ;
780+ QVariant vTabbed = Sender->property (" Tabbed" );
781+ bool Tabbed = vTabbed.isValid () ? vTabbed.toBool () : true ;
772782 auto DockWidget = d->createEditorWidget ();
773783 DockWidget->setFeature (ads::CDockWidget::DockWidgetDeleteOnClose, true );
774784 DockWidget->setFeature (ads::CDockWidget::DockWidgetForceCloseWithArea, true );
@@ -786,16 +796,13 @@ void CMainWindow::createEditor()
786796 ads::CDockAreaWidget* EditorArea = d->LastDockedEditor ? d->LastDockedEditor ->dockAreaWidget () : nullptr ;
787797 if (EditorArea)
788798 {
789- std::cout << " DockAreaCount before: " << EditorArea->dockContainer ()->dockAreaCount () << std::endl;
790799 d->DockManager ->setConfigFlag (ads::CDockManager::EqualSplitOnInsertion, true );
791800 d->DockManager ->addDockWidget (ads::RightDockWidgetArea, DockWidget, EditorArea);
792- std::cout << " DockAreaCount after: " << DockWidget->dockContainer ()->dockAreaCount () << std::endl;
793801 }
794802 else
795803 {
796804 if (d->LastCreatedFloatingEditor )
797805 {
798- std::cout << " LastCreated" << std::endl;
799806 d->DockManager ->addDockWidget (ads::RightDockWidgetArea, DockWidget, d->LastCreatedFloatingEditor ->dockAreaWidget ());
800807 }
801808 else
0 commit comments