@@ -456,13 +456,21 @@ void MainWindowPrivate::createActions()
456
456
ui.toolBar ->addAction (PerspectiveListAction);
457
457
ui.toolBar ->addAction (SavePerspectiveAction);
458
458
459
- QAction* a = ui.toolBar ->addAction (" Create Editor" );
459
+ QAction* a = ui.toolBar ->addAction (" Create Floating Editor" );
460
+ a->setProperty (" Floating" , true );
460
461
a->setToolTip (" Creates floating dynamic dockable editor windows that are deleted on close" );
461
462
a->setIcon (svgIcon (" :/adsdemo/images/note_add.svg" ));
462
463
_this->connect (a, SIGNAL (triggered ()), SLOT (createEditor ()));
463
464
ui.menuTests ->addAction (a);
464
465
465
- a = ui.toolBar ->addAction (" Create Table" );
466
+ a = ui.toolBar ->addAction (" Create Docked Editor" );
467
+ a->setProperty (" Floating" , false );
468
+ a->setToolTip (" Creates a docked editor windows that are deleted on close" );
469
+ a->setIcon (svgIcon (" :/adsdemo/images/docked_editor.svg" ));
470
+ _this->connect (a, SIGNAL (triggered ()), SLOT (createEditor ()));
471
+ ui.menuTests ->addAction (a);
472
+
473
+ a = ui.toolBar ->addAction (" Create Floating Table" );
466
474
a->setToolTip (" Creates floating dynamic dockable table with millions of entries" );
467
475
a->setIcon (svgIcon (" :/adsdemo/images/grid_on.svg" ));
468
476
_this->connect (a, SIGNAL (triggered ()), SLOT (createTable ()));
@@ -661,11 +669,22 @@ void CMainWindow::onViewVisibilityChanged(bool Visible)
661
669
// ============================================================================
662
670
void CMainWindow::createEditor ()
663
671
{
672
+ QObject* Sender = sender ();
673
+ QVariant vFloating = Sender->property (" Floating" );
674
+ bool Floating = vFloating.isValid () ? vFloating.toBool () : true ;
664
675
auto DockWidget = createEditorWidget (d->ui .menuView );
665
676
DockWidget->setFeature (ads::CDockWidget::DockWidgetDeleteOnClose, true );
666
- auto FloatingWidget = d->DockManager ->addDockWidgetFloating (DockWidget);
667
- FloatingWidget->move (QPoint (20 , 20 ));
668
677
connect (DockWidget, SIGNAL (closeRequested ()), SLOT (onEditorCloseRequested ()));
678
+
679
+ if (Floating)
680
+ {
681
+ auto FloatingWidget = d->DockManager ->addDockWidgetFloating (DockWidget);
682
+ FloatingWidget->move (QPoint (20 , 20 ));
683
+ }
684
+ else
685
+ {
686
+ d->DockManager ->addDockWidget (ads::TopDockWidgetArea, DockWidget);
687
+ }
669
688
}
670
689
671
690
0 commit comments