With Qt 5.7 Designer, is it possible to have dock widget as child of another widget, e.g. within tab widget (which is within stacked widget)?
Asked
Active
Viewed 1,808 times
3
-
As far as I know can dock widgets only be added to a QMainWindow. – Patrizio Bekerle Oct 05 '16 at 20:50
-
True in the designer. Not sure, with hand-coding. – vorlket Oct 06 '16 at 03:05
1 Answers
2
It is not possible to do this because a QDockWidget
must be docked inside a QMainWindow
, and Qt Designer does not allow a QMainWindow
to be added as a child widget.
However, in hand-written code, QMainWindow
can be treated just like any other widget and so, as per your example, it could be set as a page inside a QTabWidget
. Any dock-widgets added to that page would then behave just the same as they would in a top-level main-window.

ekhumoro
- 115,249
- 20
- 229
- 336