QQmlScriptString¶
The
QQmlScriptStringclass encapsulates a script and its context. More…

Synopsis¶
Functions¶
def
__eq__(arg__1)def
__ne__(arg__1)def
booleanLiteral()def
isEmpty()def
isNullLiteral()def
isUndefinedLiteral()def
numberLiteral()def
stringLiteral()
Detailed Description¶
QQmlScriptStringis used to createQObjectproperties that accept a script “assignment” from QML.Normally, the following QML would result in a binding being established for the
scriptproperty; i.e.scriptwould be assigned the value obtained from runningmyObj.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 thescriptproperty and the class could choose how to handle it. Typically, the class will evaluate the script at some later time using aQQmlExpression.QQmlExpression expr(scriptString); expr.evaluate();See also
- class PySide2.QtQml.QQmlScriptString¶
PySide2.QtQml.QQmlScriptString(arg__1)
- param arg__1:
Constructs an empty instance.
Copies
other.
- PySide2.QtQml.QQmlScriptString.booleanLiteral()¶
- Return type:
PyTuple
If the content of the
QQmlScriptStringis a boolean literal, returns the boolean value and setsokto true. Otherwise returns false and setsokto false.
- PySide2.QtQml.QQmlScriptString.isEmpty()¶
- Return type:
bool
Returns whether the
QQmlScriptStringis empty.
- PySide2.QtQml.QQmlScriptString.isNullLiteral()¶
- Return type:
bool
Returns whether the content of the
QQmlScriptStringis thenullliteral.
- PySide2.QtQml.QQmlScriptString.isUndefinedLiteral()¶
- Return type:
bool
Returns whether the content of the
QQmlScriptStringis theundefinedliteral.
- PySide2.QtQml.QQmlScriptString.numberLiteral()¶
- Return type:
PyTuple
If the content of the
QQmlScriptStringis a number literal, returns that number and setsokto true. Otherwise returns 0.0 and setsokto false.
- PySide2.QtQml.QQmlScriptString.__ne__(arg__1)¶
- Parameters:
arg__1 –
PySide2.QtQml.QQmlScriptString- Return type:
bool
Returns
trueif this and theotherQQmlScriptStringobjects are different.See also
operator==()
- PySide2.QtQml.QQmlScriptString.__eq__(arg__1)¶
- Parameters:
arg__1 –
PySide2.QtQml.QQmlScriptString- Return type:
bool
Returns
trueif this and theotherQQmlScriptStringobjects are equal.See also
operator!=()
- PySide2.QtQml.QQmlScriptString.stringLiteral()¶
- Return type:
str
If the content of the
QQmlScriptStringis a string literal, returns that string. Otherwise returns a nullQString.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.