@@ -544,6 +544,14 @@ void MainWindowPrivate::createActions()
544
544
_this->connect (a, SIGNAL (triggered ()), SLOT (createEditor ()));
545
545
ui.menuTests ->addAction (a);
546
546
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
+
547
555
a = ui.toolBar ->addAction (" Create Floating Table" );
548
556
a->setToolTip (" Creates floating dynamic dockable table with millions of entries" );
549
557
a->setIcon (svgIcon (" :/adsdemo/images/grid_on.svg" ));
@@ -769,6 +777,8 @@ void CMainWindow::createEditor()
769
777
QObject* Sender = sender ();
770
778
QVariant vFloating = Sender->property (" Floating" );
771
779
bool Floating = vFloating.isValid () ? vFloating.toBool () : true ;
780
+ QVariant vTabbed = Sender->property (" Tabbed" );
781
+ bool Tabbed = vTabbed.isValid () ? vTabbed.toBool () : true ;
772
782
auto DockWidget = d->createEditorWidget ();
773
783
DockWidget->setFeature (ads::CDockWidget::DockWidgetDeleteOnClose, true );
774
784
DockWidget->setFeature (ads::CDockWidget::DockWidgetForceCloseWithArea, true );
@@ -786,16 +796,13 @@ void CMainWindow::createEditor()
786
796
ads::CDockAreaWidget* EditorArea = d->LastDockedEditor ? d->LastDockedEditor ->dockAreaWidget () : nullptr ;
787
797
if (EditorArea)
788
798
{
789
- std::cout << " DockAreaCount before: " << EditorArea->dockContainer ()->dockAreaCount () << std::endl;
790
799
d->DockManager ->setConfigFlag (ads::CDockManager::EqualSplitOnInsertion, true );
791
800
d->DockManager ->addDockWidget (ads::RightDockWidgetArea, DockWidget, EditorArea);
792
- std::cout << " DockAreaCount after: " << DockWidget->dockContainer ()->dockAreaCount () << std::endl;
793
801
}
794
802
else
795
803
{
796
804
if (d->LastCreatedFloatingEditor )
797
805
{
798
- std::cout << " LastCreated" << std::endl;
799
806
d->DockManager ->addDockWidget (ads::RightDockWidgetArea, DockWidget, d->LastCreatedFloatingEditor ->dockAreaWidget ());
800
807
}
801
808
else
0 commit comments