PySide.QtScript.QScriptString class acts as a handle to “interned” strings in a PySide.QtScript.QScriptEngine .
PySide.QtScript.QScriptString can be used to achieve faster (repeated) property getting/setting, and comparison of property names, of script objects.
To get a PySide.QtScript.QScriptString representation of a string, pass the string to QScriptEngine.toStringHandle() . The typical usage pattern is to register one or more pre-defined strings when setting up your script environment, then subsequently use the relevant PySide.QtScript.QScriptString as argument to e.g. QScriptValue.property() .
Call the PySide.QtScript.QScriptString.toString() function to obtain the string that a PySide.QtScript.QScriptString represents.
Call the PySide.QtScript.QScriptString.toArrayIndex() function to convert a PySide.QtScript.QScriptString to an array index. This is useful when using PySide.QtScript.QScriptClass to implement array-like objects.
参数: | other – PySide.QtScript.QScriptString |
---|
Constructs an invalid PySide.QtScript.QScriptString .
构造新 PySide.QtScript.QScriptString that is a copy of other .
返回类型: | PySide.QtCore.bool |
---|
返回 true,若此 PySide.QtScript.QScriptString is valid; otherwise returns false.
参数: | other – PySide.QtScript.QScriptString |
---|---|
返回类型: | PySide.QtCore.bool |
返回 true,若此 PySide.QtScript.QScriptString is not equal to other ;否则返回 false。
参数: | other – PySide.QtScript.QScriptString |
---|---|
返回类型: | PySide.QtCore.bool |
返回 true,若此 PySide.QtScript.QScriptString is equal to other ;否则返回 false。
返回类型: | PySide.QtCore.quint32 |
---|
Attempts to convert this PySide.QtScript.QScriptString 到 QtScript array index, and returns the result.
If a conversion error occurs, *``ok`` is set to false; otherwise *``ok`` is set to true.
返回类型: | unicode |
---|
Returns the string that this PySide.QtScript.QScriptString represents, or a null string if this PySide.QtScript.QScriptString is not valid.