The 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.
Parameters: | other – PySide.QtScript.QScriptString |
---|
Constructs an invalid PySide.QtScript.QScriptString .
Constructs a new PySide.QtScript.QScriptString that is a copy of other .
Return type: | PySide.QtCore.bool |
---|
Returns true if this PySide.QtScript.QScriptString is valid; otherwise returns false.
Parameters: | other – PySide.QtScript.QScriptString |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if this PySide.QtScript.QScriptString is not equal to other ; otherwise returns false.
Parameters: | other – PySide.QtScript.QScriptString |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if this PySide.QtScript.QScriptString is equal to other ; otherwise returns false.
Parameters: | ok – PySide.QtCore.bool |
---|---|
Return type: | PySide.QtCore.quint32 |
Attempts to convert this PySide.QtScript.QScriptString to a QtScript array index, and returns the result.
If a conversion error occurs, *``ok`` is set to false; otherwise *``ok`` is set to true.
Return type: | unicode |
---|
Returns the string that this PySide.QtScript.QScriptString represents, or a null string if this PySide.QtScript.QScriptString is not valid.