[webkit-qt] Can I return MyQObject from a slot.
mikelima at cirulla.net
Sun Nov 29 02:57:50 PST 2009
On sabato 28 novembre 2009, Mital Vora wrote:
> hey guys,
> doubts related to this.
I'm relatively a newbie too, but I've done some experiment.
> 1) can I return custom datatype (a class derived from QObject) MyQObject
> from a slot.
You can do this. I think it has to be a QObject, though.
And you should return it as QObject or QWidget, not as a subclass.
> am able to access various properties of MyQObject2 using
I've not tried this, but it should be basically the same as the case above.
> 3) can I do things like "var obj = new MyQObject(["abc", 1]);" using the
> new operator to create a new object of a particular type.
I've never done this; the closer thing I tried was a MyObjectFactory returning
a MyObject instance.
Since a QObject constructor is not a slot, I don't think this works.
But you can try declaring the constructor Q_INVOKABLE and see if it works.
Be sure to tell me if it does... :)
> figure out how should I do it using Qt.
What I'm still trying to find out is how to obtain a pointer to the currently
used engine (to return an array of values, for example).
Luciano Montanaro //
\X/ mikelima at cirulla.net
More information about the webkit-qt