How to set Active Tab in DockWidget?
-
Dear all,
I used as tab style to set two DockWidget Widgets in QMainWindow.
@addDockWidget(Qt::LeftDockWidgetArea,firstDock,Qt::Vertical);
addDockWidget(Qt::LeftDockWidgetArea,secondDock,Qt::Vertical);
this->tabifyDockWidget(firstDock,secondDock);@After this, secondDock is set on the right of the firstDock & secondDock becomes current Tab.
How can I set firstDock as current Tab without changing current order (first, second)?Thanks
-
Quote from docs ...
bq. Two dock widgets may also be stacked on top of each other. A QTabBar is then used to select which of the widgets that should be displayed.
Maybe if you find this tabbar pointer ... :-) (I don't know, maybe somebody else have the solution)
-
Dear all,
I used as tab style to set two DockWidget Widgets in QMainWindow.
@addDockWidget(Qt::LeftDockWidgetArea,firstDock,Qt::Vertical);
addDockWidget(Qt::LeftDockWidgetArea,secondDock,Qt::Vertical);
this->tabifyDockWidget(firstDock,secondDock);@After this, secondDock is set on the right of the firstDock & secondDock becomes current Tab.
How can I set firstDock as current Tab without changing current order (first, second)?Thanks
@zither I know I'm likely talking to a zombie... but with Qt 6 (and likely earlier but I have not confirmed)
After you tabify with
this->tabifyDockWidget(firstDock,secondDock)simply call
firstDock->raise()