[Qtscript-bindings] Inheritance like qt script bindings.

Ian Monroe ian.monroe at gmail.com
Tue Feb 16 14:10:52 CET 2010


On Tue, Feb 16, 2010 at 5:19 AM, asvil <asvil at open.by> wrote:
> Hi,
>
> I have simple c++ class
> class FormWidget : public  QWidget {
> public:
>        FormWidget(QWidget *parent = 0):QWidget(parent){}
>        Q_INVOKABLE void someMethod();
>        Q_INVOKABLE void someMethod2();
> private:
> }
> Next i do:
>
> QScriptValue ctor = qScriptValueFromQMetaObject<FormWidget>(engine);

This doesn't work, the meta object just has enums and properities. It
doesn't have slots and invokables (I don't think). Basically you need
to use QScriptable and friends to create default prototypes even for
QObjects.

Read this about 10 times and it will start to make sense:
http://doc.trolltech.com/4.6/scripting.html


More information about the Qtscript-bindings mailing list