PDA

View Full Version : Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) construct paramst



sergey_85
23rd November 2009, 09:51
Hi!

I try to use my c++ object in qtScript and I need to create c++ object in QtScript with several arg such as

var p = new Report("report1",9);


but Q_SCRIPT_DECLARE_QMETAOBJECT(Report, QObject*) has 1 params....

Is it possible to construct my own c++ object in qt script with sevral constuctor params&

Thanks.

user14921
4th October 2011, 06:44
bump bump
would love to know this too if even possible or some other kind of workaround

pkj
5th October 2011, 17:41
Use QScriptable class. Also view the default prototype example.

user14921
6th October 2011, 04:26
yea i got it now using Q_DECLARE_METATYPE and a constructor function now..
its just the documentation is kind of confusing