[PyQt] How do you declare enum / flag based pyqtProperties in PyQT just like Q_ENUMS / Q_FLAGS macroes?

Phil Thompson phil at riverbankcomputing.com
Wed Feb 23 10:46:07 GMT 2011


On Wed, 23 Feb 2011 01:51:46 +0100, Yasin Uludag
<yasin.uludag at futuregames.se> wrote:
> Hey!
> 
> I'm developing a propertygrid and I'd like to support flags and enums.
> Though I couldn't find the information on how to declare pyqtProperties
as
> enums / flags so I can later use
>
*enumerator<http://mail.google.com/a/futuregames.se/qmetaproperty.html#enumerator>
> * () of the QMetaProperty.. (you know the rest :) )
> 
> In C++ this is done by using Q_ENUMS and Q_FLAGS. These are available in
> the
> QtCore so I think I'm just missing something :)
> 
> A quick sample or even forwarding me to the right path is enough :)
> 
> Best regards!

You can define properties with an existing enum type. However PyQt doesn't
(at the moment) allow you to define new enum types.

Phil


More information about the PyQt mailing list