No support for QDialog's ``open()`` method
Opened this issue · 0 comments
QtModern: 0.2.0
Python: 3.9
PyQt: 5
OS: Windows
I'm using QtModern to style a project, and as I was looking to integrate a QDialog, I noticed there doesn't seem to be a way to use the open()
function of a window within the ModernWindow class, only the show()
(which is shared with QMainWindow among others). Open is important because it allows you to 'freeze' all other windows and direct the user to the dialog, whereas show only displays it as a normal widget.
I've tried rolling back to Issue #48 to use that version of the ModernDialog class, but nothing seems to work.
Here's a sample method within my Main Window class:
1: def askForUpdate(self) -> None:
2: self.dialog = dlg() # Basic object (inherits from QDialog)
3: self.dialog = qtmodern.windows.ModernWindows(self.dialog, parent=self)
4: self.dialog.show() # This works, but is pretty useless since my user doesn't know they have to input
5: self.dialog.open() # Does not work (no popup at all, however, functions just fine when line 3 is commented out, which makes be believe it isn't an issue on my end
Edited to add:
I am aware that this can be worked around by inserting the following in between lines 4 and 5:
self.dialog.setWindowModality(Qt.Qt.WindowModal)
However, I was hoping there was a way to either allow for the open method to be accessed or integrate this natively into the class and override the open method within the ModernWindow class.