Question regarding enums and IntEnum/IntFlags

Florian Bruhin me at the-compiler.org
Fri Feb 16 23:13:16 GMT 2024


Hey,

> I'm wondering if there's a specific reason why some Qt enums are exposed as
> IntEnum/IntFlags, and others not?

They're exposed as IntEnum/IntFlag if the underlying C++ API uses them
in such a way - e.g. QEvent.Type (due to QEvent.Type.User), or
Qt.ItemDataRole (Qt.ItemDataRole.UserRole) or QUrl.UrlFormattingOption
(can be mixed with Qt.ComponentFormttingOption).

> Specifically, I'm looking at Qt.ItemFlag (which I'd have expected to be an
> IntFlags type) and Qt.CheckState (which I'd expected to be an IntEnum type).

Why?

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240217/de710447/attachment.sig>


More information about the PyQt mailing list