Subclassed QDialog, exec() calls after the first one, don't raise the dialog!
-
wrote on 23 Sept 2018, 19:35 last edited by
I have a working custom QDialog in PyQt5, python 3.5.2. There is a main window, that invokes the dialogs. The first invokation (using exec_()) succeeds. But calling exec_() again fails to put the dialog on top. It's present in the task bar only, so I have to go and click on it. But I need it to raise to the top every time!
Is this because I'm not using the parent parameter of the QDialog constructor? I'll test that out...
-
wrote on 23 Sept 2018, 19:38 last edited by
This fixes it:
self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint)
-
This fixes it:
self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint)
wrote on 23 Sept 2018, 19:43 last edited by JonB@enjoysmath
I wouldn't expect to need to use that, and would have thought it could lead to other problems. A dialog should be on top anyway. Did you try just passing the main window as the parent?
1/3