QQmlScriptString ClassThe QQmlScriptString class encapsulates a script and its context. More... #include <QQmlScriptString> This class was introduced in Qt 4.7. Public Functions
Detailed DescriptionThe QQmlScriptString class encapsulates a script and its context. QQmlScriptString is used to create QObject properties that accept a script "assignment" from QML. Normally, the following QML would result in a binding being established for the script property; i.e. script would be assigned the value obtained from running myObj.value = Math.max(myValue, 100) MyType { script: myObj.value = Math.max(myValue, 100) } If instead the property had a type of QQmlScriptString, the script itself -- myObj.value = Math.max(myValue, 100) -- would be passed to the script property and the class could choose how to handle it. Typically, the class will evaluate the script at some later time using a QQmlExpression. QQmlExpression expr(scriptString); expr.evaluate(); See also QQmlExpression. Member Function Documentation
|