PDA

View Full Version : QtScript and creating non QObject based objects



tbscope
12th November 2010, 11:09
References:
http://doc.qt.nokia.com/4.7/scripting.html#managing-non-qobject-based-objects
http://doc.qt.nokia.com/4.7/object.html

I need to create several objects that inherit multiple other objects.
Example:


class A: public B, public C

I can not use QObject based classes (for all these classes) since you can only inherit QObject once for obvious reasons.

Therefor I need to add non QObject based objects to the script engine.
The documentation explains how to do that, but it doesn't really explain the availability of the members of this object.

Are all public members available? I'm very sure they aren't.
Obviously I can't create a Q_PROPERTY or slot.

Does anyone have some experience with this? It can save me a couple of days of testing.
I guess that I need to use setProperty for each and every member I want to make available to the script.


Edit:
Never mind: I once again failed to read the documentation correctly.
The documentation contains, surprise surprise, an example of this.

user14921
5th October 2011, 08:20
The documentation explains how to do that, but it doesn't really explain the availability of the members of this object.

can someone please link me to that? all i can find is qobject based stuff