Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QScriptProgram Class

TheQScriptProgram class encapsulates a Qt Script program.More...

Header:#include <QScriptProgram>
Since: Qt 4.7

Public Functions

QScriptProgram()
QScriptProgram(const QString & sourceCode, const QString fileName = QString(), int firstLineNumber = 1)
QScriptProgram(const QScriptProgram & other)
~QScriptProgram()
QStringfileName() const
intfirstLineNumber() const
boolisNull() const
QStringsourceCode() const
booloperator!=(const QScriptProgram & other) const
QScriptProgram &operator=(const QScriptProgram & other)
booloperator==(const QScriptProgram & other) const

Detailed Description

TheQScriptProgram class encapsulates a Qt Script program.

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);

Member Function Documentation

QScriptProgram::QScriptProgram()

Constructs a nullQScriptProgram.

QScriptProgram::QScriptProgram(constQString & sourceCode, constQString fileName = QString(),int firstLineNumber = 1)

Constructs a newQScriptProgram with the givensourceCode,fileName andfirstLineNumber.

QScriptProgram::QScriptProgram(constQScriptProgram & other)

Constructs a newQScriptProgram that is a copy ofother.

QScriptProgram::~QScriptProgram()

Destroys thisQScriptProgram.

QString QScriptProgram::fileName() const

Returns the filename associated with this program.

int QScriptProgram::firstLineNumber() const

Returns the line number associated with this program.

bool QScriptProgram::isNull() const

Returns true if thisQScriptProgram is null; otherwise returns false.

QString QScriptProgram::sourceCode() const

Returns the source code of this program.

bool QScriptProgram::operator!=(constQScriptProgram & other) const

Returns true if thisQScriptProgram is not equal toother; otherwise returns false.

QScriptProgram & QScriptProgram::operator=(constQScriptProgram & other)

Assigns theother value to thisQScriptProgram.

bool QScriptProgram::operator==(constQScriptProgram & other) const

Returns true if thisQScriptProgram is equal toother; otherwise returns false.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp