I want to keep a modeless dialog window on top of the main QGIS window. This issue has been discussed before and two solutions have been offered:
self.dlg.setWindowFlags(Qt.WindowStaysOnTopHint). This is unsatisfactory because the dialog window stays on top of every application window, not just the QGIS one.- Give the dialog an owner when it is created, as in
self.dlg = MyCreatorDialog(self.iface.mainWindow()). This does indeed keep the dialog on top of the application's main window, but sets the dialog as modal, so the underlying window is inaccessible.
The processing toolbox creates modeless dialog boxes that stay on top of the application window, but not on top of other applications. How does it do it?