QQmlScriptString¶
The
QQmlScriptString
class 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¶
QQmlScriptString
is used to createQObject
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 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 thescript
property 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
QQmlScriptString
¶ QQmlScriptString(arg__1)
- param arg__1
Constructs an empty instance.
Copies
other
.
-
PySide2.QtQml.QQmlScriptString.
booleanLiteral
()¶ - Return type
PyTuple
If the content of the
QQmlScriptString
is a boolean literal, returns the boolean value and setsok
to true. Otherwise returns false and setsok
to false.
-
PySide2.QtQml.QQmlScriptString.
isEmpty
()¶ - Return type
bool
Returns whether the
QQmlScriptString
is empty.
-
PySide2.QtQml.QQmlScriptString.
isNullLiteral
()¶ - Return type
bool
Returns whether the content of the
QQmlScriptString
is thenull
literal.
-
PySide2.QtQml.QQmlScriptString.
isUndefinedLiteral
()¶ - Return type
bool
Returns whether the content of the
QQmlScriptString
is theundefined
literal.
-
PySide2.QtQml.QQmlScriptString.
numberLiteral
()¶ - Return type
PyTuple
If the content of the
QQmlScriptString
is a number literal, returns that number and setsok
to true. Otherwise returns 0.0 and setsok
to false.
-
PySide2.QtQml.QQmlScriptString.
__ne__
(arg__1)¶ - Parameters
arg__1 –
QQmlScriptString
- Return type
bool
Returns
true
if this and theother
QQmlScriptString
objects are different.See also
operator==()
-
PySide2.QtQml.QQmlScriptString.
__eq__
(arg__1)¶ - Parameters
arg__1 –
QQmlScriptString
- Return type
bool
Returns
true
if this and theother
QQmlScriptString
objects are equal.See also
operator!=()
-
PySide2.QtQml.QQmlScriptString.
stringLiteral
()¶ - Return type
unicode
If the content of the
QQmlScriptString
is a string literal, returns that string. Otherwise returns a nullQString
.