QAxScriptEngine Class

The QAxScriptEngine class provides a wrapper around a script engine. 更多...

头文件: #include <QAxScriptEngine>
qmake: QT += axcontainer
基类: QAxObject

公有类型

enum State { Uninitialized, Initialized, Started, Connected, Disconnected, Closed }

公有函数

QAxScriptEngine(const QString &language, QAxScript *script)
~QAxScriptEngine()
void addItem(const QString &name)
bool hasIntrospection() const
bool isValid() const
long queryInterface(const QUuid &uuid, void **iface) const
QString scriptLanguage() const
void setState(State st)
State state() const

重新实现的受保护函数

virtual bool initialize(IUnknown **ptr)
  • 1 个受保护的函数继承自 QAxObject
  • 9 个受保护的函数继承自 QObject
  • 5 个受保护的函数继承自 QAxBase

其他继承的成员

  • 1 个属性继承自 QObject
  • 1 个属性继承自 QAxBase
  • 1 个公有槽函数继承自 QObject
  • 2 个信号继承自 QObject
  • 3 个信号继承自 QAxBase
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 1 个受保护的函数继承自 QAxObject
  • 9 个受保护的函数继承自 QObject
  • 5 个受保护的函数继承自 QAxBase
  • 2 个受保护的变量继承自 QObject

详细描述

The QAxScriptEngine class provides a wrapper around a script engine.

Every instance of the QAxScriptEngine class represents an interpreter for script code in a particular scripting language. The class is usually not used directly. The QAxScript and QAxScriptManager classes provide convenient functions to handle and call script code.

Direct access to the script engine is provided through queryInterface().

Warning: This class is not available with the bcc5.5 compiler.

参见 QAxScript, QAxScriptManager, QAxBase, and ActiveQt Framework.

成员类型

enum QAxScriptEngine::State

The State enumeration defines the different states a script engine can be in.

ConstantValueDescription
QAxScriptEngine::Uninitialized0The script has been created, but not yet initialized
QAxScriptEngine::Initialized5The script has been initialized, but is not running
QAxScriptEngine::Started1The script can execute code, but does not yet handle events
QAxScriptEngine::Connected2The script can execute code and is connected so that it can handle events
QAxScriptEngine::Disconnected3The script is loaded, but is not connected to event sources
QAxScriptEngine::Closed4The script has been closed.

成员函数

QAxScriptEngine::QAxScriptEngine(const QString &language, QAxScript *script)

Constructs a QAxScriptEngine object interpreting script code in language provided by the code in script. This is usually done by the QAxScript class when loading a script.

Instances of QAxScriptEngine should always have both a language and a script.

QAxScriptEngine::~QAxScriptEngine()

Destroys the QAxScriptEngine object, releasing all allocated resources.

void QAxScriptEngine::addItem(const QString &name)

Registers an item with the script engine. Script code can refer to this item using name.

bool QAxScriptEngine::hasIntrospection() const

Returns true if the script engine supports introspection; otherwise returns false.

[virtual protected] bool QAxScriptEngine::initialize(IUnknown **ptr)

Reimplemented from QAxBase::initialize().

bool QAxScriptEngine::isValid() const

Returns true if the script engine has been initialized correctly; otherwise returns false.

long QAxScriptEngine::queryInterface(const QUuid &uuid, void **iface) const

Requests the interface uuid from the script engine object and sets the value of iface to the provided interface, or to 0 if the requested interface could not be provided.

Returns the result of the QueryInterface implementation of the COM object.

QString QAxScriptEngine::scriptLanguage() const

Returns the scripting language, for example "VBScript", or "JScript".

void QAxScriptEngine::setState(State st)

Sets the state of the script engine to st. Calling this function is usually not necessary.

参见 state().

State QAxScriptEngine::state() const

Returns the state of the script engine.

参见 setState().