pyqtconfig
pyqtconfig copied to clipboard
The settings_dialog_demo.py needs changes to work on Windows 10/11 and ZorinOS 16.3 Pro (Ubuntu) for PyQt6
In settings_dialog_demo.py line 48:
config_dialog = ConfigDialog(self.config, self, cols=2, f=Qt.WindowCloseButtonHint)
needs to be:
config_dialog = ConfigDialog(self.config, self, cols=2, flags=Qt.WindowType.WindowCloseButtonHint)
The PySide6 QDialog docs here
indicates that the "flags=" parameter name should be "f=". But with my PyQt6 installation it is "flags=".
I see in your config.py:ConfigDialog at line 1189 there is some code to try and handle the "f=" versus "flags=" issue for PyQt5 and PySide2, but not PyQt6 and PySide6, the relentless march of time changes things...
I thought the f= versus flags= was my real problem until I ran this on ZorinOS and I got more failure info than running it on Windows which informed me that:
f=Qt.WindowCloseButtonHint,
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Qt' has no attribute 'WindowCloseButtonHint'
It must be Qt.WindowType.WindowCloseButtonHint for PyQt6.
The PySide6 docs do not mention WindowType at all, there it is still: Qt.WindowCloseButtonHint.
So alot of confusion here. And to add insult to injury, not even passing the window manager hint flag on Windows and ZorinOs (Ubuntu) makes any difference. So I suspect this flag might make a difference on Mac -- I have not tried it there yet. My Macbook is in the closet somewhere.
Anyway, thanks for making pygqconfig -- it is really helpful -- and I thought you might be interested to having this information.