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

    上一话题

    QScriptEngineAgent

    下一话题

    QScriptString

    QScriptProgram

    注意

    This class was introduced in Qt 4.7

    概要

    函数

    详细描述

    PySide.QtScript.QScriptProgram class encapsulates a Qt Script program.

    PySide.QtScript.QScriptProgram retains the compiled representation of the script if possible. Thus, PySide.QtScript.QScriptProgram can be used to evaluate the same script multiple times more efficiently.

    QScriptEngine engine;
    QScriptProgram program("1 + 2");
    QScriptValue result = engine.evaluate(program);
    									
    class PySide.QtScript. QScriptProgram
    class PySide.QtScript. QScriptProgram ( other )
    class PySide.QtScript. QScriptProgram ( sourceCode [ , fileName="" [ , firstLineNumber=1 ] ] )
    参数:

    Constructs a null PySide.QtScript.QScriptProgram .

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

    构造新 PySide.QtScript.QScriptProgram with the given sourceCode , fileName and firstLineNumber .

    PySide.QtScript.QScriptProgram. fileName ( )
    返回类型: unicode

    Returns the filename associated with this program.

    PySide.QtScript.QScriptProgram. firstLineNumber ( )
    返回类型: PySide.QtCore.int

    Returns the line number associated with this program.

    PySide.QtScript.QScriptProgram. isNull ( )
    返回类型: PySide.QtCore.bool

    返回 true,若此 PySide.QtScript.QScriptProgram is null; otherwise returns false.

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

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

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

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

    PySide.QtScript.QScriptProgram. sourceCode ( )
    返回类型: unicode

    Returns the source code of this program.