Answer the question
In order to leave comments, you need to log in
Why is there no access to the children of QObjects in the scripting engine via QJSEngine?
Good day to all!
We have a widget and want to make it, along with its child objects, available in the scripting engine. For example, the widget myWidget with the button myButton.
This is how it all works:
QScriptEngine engine;
QWidget *myWidget = new QWidget;
QScriptValue objectValue = engine.newQObject(myWidget);
engine.globalObject().setProperty("myWidget", objectValue);
myWidget.myButton.objectName = "Another name" // Ok
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question