Dear all,
I would like to use QtScript in order to test a data model for an application, try all the methods, and the behaviour of the GUI during the modification of the data model.

To do this, I would like to create a script console in which the developer could create and use some QObject child (classes that represents the data model) using script.

I read the documentation and I understand well that I can use any instance of data model classes with this method:

Qt Code:
  1. void ScriptConsole::addQObjectInstance(QObject *object, const QString &name)
  2. {
  3. QScriptValue objectValue = m_engine.newQObject(object);
  4. m_engine.globalObject().setProperty(name, objectValue);
  5. }
To copy to clipboard, switch view to plain text mode 

How can I use some classes of the data model inside the script ?
I need to define, in some way, the possibility to create new objects of particular classes (that inherit QObject) in the script.

Thanks in advance,

Angelo