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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With