[PyQt] Getting parent class for an enum

Denis Rouzaud denis.rouzaud at gmail.com
Wed May 16 13:57:14 BST 2018


Hi,

In the case of an enum (with Q_ENUM macro), it would be interesting to have
a way to get the parent class to be able to get the meta enum from the enum
value (enumValue):

base = type(enumValue).parentClass()
idx = base.staticMetaObject.indexOfEnumerator(type(enumValue).__name__)
metaenum = base.staticMetaObject.enumerator(idx)

Would it be possible to add this capability to sip.enumType ?
Either to return the parent class or directly the metaEnum?

Phil, how complicate is it?
Do you have any interest/plan to do it...?

Cheers,
Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180516/c0ae7651/attachment.html>


More information about the PyQt mailing list