[Qt-qml] QML + enum
Gregory Schlomoff
gregory.schlomoff at gmail.com
Sat Mar 5 05:40:10 CET 2011
You must use the Q_ENUMS macro to register your enum.
It's all explained here:
http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html#using-enumerations-of-a-custom-type
By the way, there's a lot of excellent advice on this single page for
inegrating QML with C++. I highly recommend reading it from top to bottom
toroughly. :)
<http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html#using-enumerations-of-a-custom-type>
Cheers
greg
On Fri, Mar 4, 2011 at 5:58 AM, Tibo W <tibo_wcc at yahoo.com> wrote:
> Hi,
>
> I have an enum defined in a common.h, so many classes can access it.
> I'd like to have this enum visible from QML because I want to send signals
> with this enum.
>
> It seems that there's a way to do it if the enum belongs to a class and the
> class is registered using "qmlRegisterType".
>
> But is there any other way ?
>
> thanks in advance
>
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110305/3981d9ca/attachment.html
More information about the Qt-qml
mailing list