注意
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);
| 参数: |
|
|---|
Constructs a null PySide.QtScript.QScriptProgram .
构造新 PySide.QtScript.QScriptProgram that is a copy of other .
构造新 PySide.QtScript.QScriptProgram 采用给定 sourceCode , fileName and firstLineNumber .
| 返回类型: | unicode |
|---|
Returns the filename associated with this program.
| 返回类型: | PySide.QtCore.int |
|---|
Returns the line number associated with this program.
| 返回类型: | PySide.QtCore.bool |
|---|
返回 true,若此 PySide.QtScript.QScriptProgram is null; otherwise returns false.
| 参数: | other – PySide.QtScript.QScriptProgram |
|---|---|
| 返回类型: | PySide.QtCore.bool |
返回 true,若此 PySide.QtScript.QScriptProgram is not equal to other ;否则返回 false。
| 参数: | other – PySide.QtScript.QScriptProgram |
|---|---|
| 返回类型: | PySide.QtCore.bool |
返回 true,若此 PySide.QtScript.QScriptProgram 等于 other ;否则返回 false。
| 返回类型: | unicode |
|---|
Returns the source code of this program.