QSA-interest Archive, October 2005
slot returning a list of QObjects
Message 1 in thread
Hi
Does anybody knows what return-type a slot has to have that it returns an
array in QScript ?
I need a function which returns a List of QObjects. I tried:
QList<QObject*> getRegisteredObjects( QString type )
But using that slot results in an segmentation fault :( when it is called
through QSA. What is the official way of returning an array/list ?
Greetings
Jens
Message 2 in thread
Jens wrote:
> Hi
> Does anybody knows what return-type a slot has to have that it returns an
> array in QScript ?
>
> I need a function which returns a List of QObjects. I tried:
>
> QList<QObject*> getRegisteredObjects( QString type )
>
> But using that slot results in an segmentation fault :( when it is called
> through QSA. What is the official way of returning an array/list ?
>
> Greetings
> Jens
Hi Jens,
We are not able support arbitrary template instantiations of QList<>, so
we have added support for a few common ones. QList<int>, QObjectList,
QVariantList for instance. You should be able to use QObjectList for
returning an array of QObjects. As for the seg fault, we'll look into
that and produce a nice warning instead.
-
Gunnar