Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Adding Widgets to QDockWidget without a layout
Andaharoo last edited by Andaharoo
How do you add widgets to a QDockWidget? I do it in the designer all the time but in code all I see is a setWidget function. I tried it and it only works with one widget. How can I do this without using a layout? (The default behavior you would expect if you started dragging and dropping widgets into a dock in the designer.) The designer creates a default dockWidgetContents which is a Qwidget and then has a bunch of widgets underneath it. This all seems to imply I need to somehow add widgets to another widget and then add that widget to the dock?
@Andaharoo Set the QDockWidget as parent in those other widgets and position them then manually using for example setGeometry().