The QScriptProgram class encapsulates a Qt Script program. 更多...
| 头: | #include <QScriptProgram> | 
| qmake: | QT += script | 
| Since: | Qt 4.7 | 
该类在 Qt 4.7 引入。
| QScriptProgram (const QScriptProgram & other ) | |
| QScriptProgram (const QString & sourceCode , const QString fileName = QString(), int firstLineNumber = 1) | |
| QScriptProgram () | |
| QScriptProgram & | operator= (const QScriptProgram & other ) | 
| ~QScriptProgram () | |
| QString | fileName () const | 
| int | firstLineNumber () const | 
| bool | isNull () const | 
| QString | sourceCode () const | 
| bool | operator!= (const QScriptProgram & other ) const | 
| bool | operator== (const QScriptProgram & other ) const | 
QScriptProgram retains the compiled representation of the script if possible. Thus, 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 new QScriptProgram that is a copy of other .
Constructs a new QScriptProgram with the given sourceCode , fileName and firstLineNumber .
Constructs a null QScriptProgram.
赋值 other value to this QScriptProgram .
销毁此 QScriptProgram .
Returns the filename associated with this program.
Returns the line number associated with this program.
返回 true,若此 QScriptProgram is null; otherwise returns false.
Returns the source code of this program.
返回 true,若此 QScriptProgram 不等于 other ;否则返回 false。
返回 true,若此 QScriptProgram 等于 other ;否则返回 false。