summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/examples/hellodockwidget.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/python/examples/hellodockwidget.py b/python/examples/hellodockwidget.py
index 5f9c66ed..79df0e3f 100644
--- a/python/examples/hellodockwidget.py
+++ b/python/examples/hellodockwidget.py
@@ -94,14 +94,13 @@ class HelloDockWidget(QWidget, DockContextHandler):
return HelloDockWidget(parent, name, data)
def addStaticDockWidget():
- mw = QApplication.allWidgets()[0].window()
- dock_handler = mw.findChild(DockHandler, '__DockHandler')
- dock_widget = HelloDockWidget.create_widget("HelloDockWidget (Static Dock)", dock_handler.parent())
+ dock_handler = DockHandler.getActiveDockHandler()
+ parent = dock_handler.parent()
+ dock_widget = HelloDockWidget.create_widget("HelloDockWidget (Static Dock)", parent)
dock_handler.addDockWidget(dock_widget, Qt.BottomDockWidgetArea, Qt.Horizontal, True, False)
def addDynamicDockWidget():
- mw = QApplication.allWidgets()[0].window()
- dock_handler = mw.findChild(DockHandler, '__DockHandler')
+ dock_handler = DockHandler.getActiveDockHandler()
dock_handler.addDockWidget("HelloDockWidget (Dynamic Dock)", HelloDockWidget.create_widget, Qt.BottomDockWidgetArea, Qt.Horizontal, True)
addStaticDockWidget()