QQmlScriptStringclass encapsulates a script and its context. 更多 …
def
__eq__
(arg__1)
def
__ne__
(arg__1)
def
booleanLiteral
()
def
isEmpty
()
def
isNullLiteral
()
def
isUndefinedLiteral
()
def
numberLiteral
()
def
stringLiteral
()
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();另请参阅
QQmlScriptString
¶
QQmlScriptString(arg__1)
- param arg__1
Constructs an empty instance.
拷贝
other
.
PySide2.QtQml.QQmlScriptString.
booleanLiteral
(
)
¶
PyTuple
If the content of the
QQmlScriptString
is a boolean literal, returns the boolean value and sets
ok
to true. Otherwise returns false and sets
ok
为 false。
PySide2.QtQml.QQmlScriptString.
isEmpty
(
)
¶
bool
Returns whether the
QQmlScriptString
is empty.
PySide2.QtQml.QQmlScriptString.
isNullLiteral
(
)
¶
bool
Returns whether the content of the
QQmlScriptString
是
null
literal.
PySide2.QtQml.QQmlScriptString.
isUndefinedLiteral
(
)
¶
bool
Returns whether the content of the
QQmlScriptString
是
undefined
literal.
PySide2.QtQml.QQmlScriptString.
numberLiteral
(
)
¶
PyTuple
If the content of the
QQmlScriptString
is a number literal, returns that number and sets
ok
to true. Otherwise returns 0.0 and sets
ok
为 false。
PySide2.QtQml.QQmlScriptString.
__ne__
(
arg__1
)
¶
arg__1
–
QQmlScriptString
bool
返回
true
若此和
other
QQmlScriptString
objects are different.
另请参阅
operator==()
PySide2.QtQml.QQmlScriptString.
__eq__
(
arg__1
)
¶
arg__1
–
QQmlScriptString
bool
返回
true
若此和
other
QQmlScriptString
对象是相等的。
另请参阅
operator!=()
PySide2.QtQml.QQmlScriptString.
stringLiteral
(
)
¶
unicode
If the content of the
QQmlScriptString
is a string literal, returns that string. Otherwise returns a null
QString
.