Handling of flags in PyQt5 / PyQt6
Florian Bruhin
me at the-compiler.org
Tue Mar 16 16:16:01 GMT 2021
Hey again,
On Tue, Mar 16, 2021 at 04:55:42PM +0100, Florian Bruhin wrote:
> Or as a more compact overview:
>
> PyQt5: enum only (or unscoped)
> PyQt6: flags only
> PySide2: flags only (or unscoped)
> PySide6: flags only (or unscoped)
Well, looks like I successfully confused myself with the Alignment vs.
AlignmentFlag names. Let me try again, please disregard the earlier
mail.
PySide2 and PySide6 both allow access via the *enum* name only. To make
it clearer, let me try again with Qt.Orientation (enum) vs.
Qt.Orientations (flag):
PyQt5: Qt.Horizontal (unscoped) or Qt.Orientation.Horizontal (enum)
PyQt6: Qt.Orientations.Horizontal (flag)
PySide2: Qt.Horizontal (unscoped) or Qt.Orientation.Horizontal (enum)
PySide6: Qt.Horizontal (unscoped) or Qt.Orientation.Horizontal (enum)
So PyQt6 seems like the "oddball" here. I'm fine with using scoped
values everywhere, but I think PyQt6 should support accessing flag
values via the enum type, so that it's possible to write code which
works with PyQt5 and PyQt6 (or PyQt6 and PySide6).
Florian
--
me at the-compiler.org | https://www.qutebrowser.org
https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210316/27f857f6/attachment.sig>
More information about the PyQt
mailing list