Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Go to the source code of this file.
Classes | |
class | MyObject |
[7] More... | |
Functions | |
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject-> | setProperty ("dynamicProperty", 3) |
engine | globalObject ().setProperty("myObject" |
qDebug ()<< engine.evaluate("myObject.dynamicProperty").toInt() | |
[1] | |
engine | evaluate ("var myObject = new MyObject()") |
[8] | |
Variables | |
QJSEngine | myEngine |
[0] | |
QJSValue | three = myEngine.evaluate("1 + 2") |
QJSValue | fun = myEngine.evaluate("(function(a, b) { return a + b; })") |
[0] | |
QJSValueList | args = { object } |
QJSValue | myScriptQObject = engine.newQObject(myQObject) |
QJSValue | jsMetaObject = engine.newQMetaObject(&MyObject::staticMetaObject) |
[7] | |
engine evaluate | ( | ) |
[8]
[9]
engine globalObject | ( | ) |
qDebug | ( | ) |
[1]
[7]
[toString]
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject-> setProperty | ( | "dynamicProperty" | , |
3 | ) |
QJSValueList args = { object } |
Definition at line 12 of file src_script_qjsengine.cpp.
engine jsMetaObject = engine.newQMetaObject(&MyObject::staticMetaObject) |
QJSEngine myEngine |
[0]
Definition at line 5 of file src_script_qjsengine.cpp.
engine myScriptQObject = engine.newQObject(myQObject) |
Definition at line 65 of file src_script_qjsengine.cpp.
QJSValue three = myEngine.evaluate("1 + 2") |
Definition at line 6 of file src_script_qjsengine.cpp.