[PyQt] PyQt5 QStyleOptionButton enum problem
me at the-compiler.org
Tue Oct 27 15:57:01 GMT 2015
* Damon Lynch <damonlynch at gmail.com> [2015-10-27 20:32:59 +0500]:
> I have no idea if this is expected behaviour, but this definitely does not
> work with Python 3.4.3+ and PyQt 5.4.2:
That's because that's a SyntaxError - I think for other similar
situations it got aliased to None_ instead by PyQt, but that doesn't
seem to be the case here.
FWIW, you can do getattr(QStyleOptionButton, 'None') instead.
To ensure compatibility with later versions (when this is fixed, which
I guess will happen), you could do:
foo = QStyleOptionButton.None_
foo = getattr(QStyleOptionButton, 'None')
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: Digital signature
More information about the PyQt