[Qtscript-bindings] Inheritance like qt script bindings.

asvil asvil at open.by
Tue Feb 16 12:19:23 CET 2010


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);
engine->globalObject().setProperty(FormWidget::staticMetaObject.className(),  
ctor, flags);

This code not worked
ScriptWidget = function(parent) {
    FormWidget.call(this, parent);

    someMethod();
    someMethod2();
}

ScriptWidget.prototype = new FormWidget();

This string FormWidget.call(this, parent); not worked. I

How i can inherit class FormWidget in qt script?
I looked at the source qt script bindings. What is the shortest way to  
realize the same in my program?

Sorry for bad English.
Many thanks,
Michael.



-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/


More information about the Qtscript-bindings mailing list