• PySide 模块
  • PySide.QtScript
  • 内容表表

    上一话题

    QScriptProgram

    下一话题

    QScriptContextInfo

    QScriptString

    概要

    函数

    详细描述

    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 )
    参数: other PySide.QtScript.QScriptString

    Constructs an invalid PySide.QtScript.QScriptString .

    构造新 PySide.QtScript.QScriptString that is a copy of other .

    PySide.QtScript.QScriptString. isValid ( )
    返回类型: PySide.QtCore.bool

    返回 true,若此 PySide.QtScript.QScriptString is valid; otherwise returns false.

    PySide.QtScript.QScriptString. __ne__ ( other )
    参数: other PySide.QtScript.QScriptString
    返回类型: PySide.QtCore.bool

    返回 true,若此 PySide.QtScript.QScriptString is not equal to other ;否则返回 false。

    PySide.QtScript.QScriptString. __eq__ ( other )
    参数: other PySide.QtScript.QScriptString
    返回类型: PySide.QtCore.bool

    返回 true,若此 PySide.QtScript.QScriptString is equal to other ;否则返回 false。

    PySide.QtScript.QScriptString. toArrayIndex ( )
    返回类型: 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.

    PySide.QtScript.QScriptString. toString ( )
    返回类型: unicode

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