Table Of Contents

Previous topic

QScriptProgram

Next topic

QScriptContextInfo

QScriptString

Inheritance diagram of QScriptString

Synopsis

Functions

Detailed Description

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.

class PySide.QtScript.QScriptString
class PySide.QtScript.QScriptString(other)
Parameters:otherPySide.QtScript.QScriptString

Constructs an invalid PySide.QtScript.QScriptString .

Constructs a new PySide.QtScript.QScriptString that is a copy of other .

PySide.QtScript.QScriptString.isValid()
Return type:PySide.QtCore.bool

Returns true if this PySide.QtScript.QScriptString is valid; otherwise returns false.

PySide.QtScript.QScriptString.__ne__(other)
Parameters:otherPySide.QtScript.QScriptString
Return type:PySide.QtCore.bool

Returns true if this PySide.QtScript.QScriptString is not equal to other ; otherwise returns false.

PySide.QtScript.QScriptString.__eq__(other)
Parameters:otherPySide.QtScript.QScriptString
Return type:PySide.QtCore.bool

Returns true if this PySide.QtScript.QScriptString is equal to other ; otherwise returns false.

PySide.QtScript.QScriptString.toArrayIndex([ok=0])
Parameters:okPySide.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.

PySide.QtScript.QScriptString.toString()
Return type:unicode

Returns the string that this PySide.QtScript.QScriptString represents, or a null string if this PySide.QtScript.QScriptString is not valid.