[Qt-qml] enumerations in QML
Gregory Schlomoff
gregory.schlomoff at gmail.com
Thu Aug 5 04:54:42 CEST 2010
+1, same question here
On Thu, Aug 5, 2010 at 7:36 AM, Alex <alexlordax+qt at gmail.com> wrote:
> [ Sorry, I'll stop flooding the mailing list in a minute :-) ]
>
> Is there any way to declare enumerations in QML? For example, assume I
> have a custom element called "MyText" that has a property called
> sizeType, for which the possible values are: "small", "medium", or
> "big."
>
> The implementation of MyText will set the correct point or pixel size
> based on the value of sizeType. Is there a way to expose the possible
> values using an enum (e.g., MyText::SizeBig) rather than something
> more primitive like int or string?
>
> Similarly, what is the best way to declare constants?
>
> Thanks,
> Alex
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
More information about the Qt-qml
mailing list