Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I insert QDockWidget as tab

Tags:

c++

qt

I have a lot of widgets in my application and I know I can drag them during runtime and place over another widget in order to merge them (both widgets are on same place and there are tabs under them which I can use to switch them).

How can I insert QDockWidget like this programmatically from start?

For example I want to add 2 QDockWidgets to bottom that are tabbed so that they are in same area and I can tab-switch them

like image 499
Petr Avatar asked Oct 19 '13 12:10

Petr


1 Answers

If you want to layout two or more dock widgets as tabbed windows, you can either drag one dock widget over the other (as you properly described), or do that programaticaly using QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second) function. As the function description says:

Moves second dock widget on top of first dock widget, creating a tabbed docked area in the main window.

like image 165
vahancho Avatar answered Oct 13 '22 19:10

vahancho