QScriptString Class

The QScriptString class acts as a handle to "interned" strings in a QScriptEngine. More...

Header: #include <QScriptString>
qmake: QT += script
Since: Qt 4.4

This class was introduced in Qt 4.4.

Detailed Description

QScriptString can be used to achieve faster (repeated) property getting/setting, and comparison of property names, of script objects.

To get a 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 QScriptString as argument to e.g. QScriptValue::property().

Call the toString() function to obtain the string that a QScriptString represents.

Call the toArrayIndex() function to convert a QScriptString to an array index. This is useful when using QScriptClass to implement array-like objects.