May 2019
Intermediate to advanced
542 pages
13h 37m
English
Dock widgets are similar to toolbars, but they sit between the toolbar areas and the central widget and are able to contain any kind of widget.
Adding a dock widget is much like explicitly creating a toolbar:
dock = qtw.QDockWidget("Replace") self.addDockWidget(qtc.Qt.LeftDockWidgetArea, dock)
Like toolbars, dock widgets by default can be closed, floated, or moved to another side of the application. To change whether a dock widget can be closed, floated, or moved, we have to set its features property to a combination of QDockWidget.DockWidgetFeatures flag values.
For instance, let's make it so the user cannot close our dock widget, by adding this code:
dock.setFeatures( qtw.QDockWidget.DockWidgetMovable | qtw.QDockWidget.DockWidgetFloatable ...
Read now
Unlock full access