Hi!
I want to make my Qt4.1 application scriptable, but am having trouble. My app has something like below: -
-
Object A
/ \
Object AA Object AB
/ \
Object AAA Object AAB
-
Object A
/ \
Object AA Object AB
/ \
Object AAA Object AAB
To copy to clipboard, switch view to plain text mode
i.e 'Object A' has two members 'Object AA' & 'Object AB' and 'Object AA' has two more members 'Object AAA' & 'Object AAB'.
I want all of the above objects accessible from script. For this QSA doc says:
By passing an object to the scripting engine (using QSInterpreter::addTransientObject() or QSProject::addObject()), this object and all its signals, slots, properties,
and child objects are made available to scripts
Does it means the following code alone would expose all objects to script:-
//Constructor of object A
setObjectName("ObjectA");
//Initialise all objects
.
.
.
.
qsProject = new QSProject(this);
qsProject->addObject(this);
//Constructor of object A
setObjectName("ObjectA");
//Initialise all objects
.
.
.
.
qsProject = new QSProject(this);
qsProject->addObject(this);
To copy to clipboard, switch view to plain text mode
Upon execution (While setting any property of 'ObjectAA') my app says 'ObjectAA' is undefined. This applies to all objects except 'ObjectA'.
I have also tried adding all objects to the projects but result is same.
Am i missing something? Please guide me.
Thanks in advance
Bookmarks