Qt-interest Archive, July 2007
QtScript and Q_ENUMS
Message 1 in thread
QtScript seems currently not to recognize Q_ENUMS in the meta, will this be
fixed in the next release?
(I am aware that I can work around by creating a number of read-only
properties along with declaring corresponding get functions for every enum
value, however that is very cumbersome, and not worthy for Qt IMHO).
--
[ signature omitted ]
Message 2 in thread
Seneca wrote:
>QtScript seems currently not to recognize Q_ENUMS in the meta, will this be
>fixed in the next release?
>
>(I am aware that I can work around by creating a number of read-only
>properties along with declaring corresponding get functions for every enum
>value, however that is very cumbersome, and not worthy for Qt IMHO).
>
>
Hi Seneca,
Q_ENUMS are exposed as properties of the script object you get back from
newQMetaObject(). You want them to be exposed when you use newQObject()
too? If that's the case, we have a task for that for Qt 4.4; until then
you'll have to use your work-around (or I can send you the patch against
4.3).
Regards,
Kent
--
[ signature omitted ]
Message 3 in thread
Indeed I ment the ones with newQObject(), as well as those of prototype
classes. It would be great if you could send me the patch, that would save
me quite a bit work while I am creating my application framework right now.
I can see that newQMetaObject() would also be handy in some of my
application, however here we have the vice-versa limitation that only
Q_ENUMS are working, but not the signals, slots and properties (at least the
docu says so). Are there plans to implement those items too in a next
release?
> Q_ENUMS are exposed as properties of the script object you get back from
> newQMetaObject(). You want them to be exposed when you use newQObject()
> too? If that's the case, we have a task for that for Qt 4.4; until then
> you'll have to use your work-around (or I can send you the patch against
> 4.3).
--
[ signature omitted ]