ScriptJobs attached to dockControls? How to close Qt UIs attached to a dockControl?

you can also try overriding the closeEvent method with the same logic. Otherwise you can traverse p the tree with .parentWidget() until you get a QDockWidget and then connect the visibilityChanged signal to something. Not the most elegant solution