📄 qaxscript.3qt
字号:
'\" t.TH QAxScript 3qt "2 September 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQAxScript \- Wrapper around script code.SH SYNOPSISThis class is part of the \fBQt ActiveQt Extension\fR..PP\fC#include <qaxscript.h>\fR.PPInherits QObject..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBFunctionFlags\fR { FunctionNames = 0, FunctionSignatures }".br.ti -1c.BI "\fBQAxScript\fR ( const QString & name, QAxScriptManager * manager )".br.ti -1c.BI "\fB~QAxScript\fR ()".br.ti -1c.BI "bool \fBload\fR ( const QString & code, const QString & language = QString::null )".br.ti -1c.BI "QStringList \fBfunctions\fR ( FunctionFlags flags = FunctionNames ) const".br.ti -1c.BI "QString \fBscriptCode\fR () const".br.ti -1c.BI "QString \fBscriptName\fR () const".br.ti -1c.BI "QAxScriptEngine * \fBscriptEngine\fR () const".br.ti -1c.BI "QVariant \fBcall\fR ( const QString & function, const QVariant & var1 = QVariant ( ), const QVariant & var2 = QVariant ( ), const QVariant & var3 = QVariant ( ), const QVariant & var4 = QVariant ( ), const QVariant & var5 = QVariant ( ), const QVariant & var6 = QVariant ( ), const QVariant & var7 = QVariant ( ), const QVariant & var8 = QVariant ( ) )".br.ti -1c.BI "QVariant \fBcall\fR ( const QString & function, QValueList<QVariant> & arguments )".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBentered\fR ()".br.ti -1c.BI "void \fBfinished\fR ()".br.ti -1c.BI "void \fBfinished\fR ( const QVariant & result )".br.ti -1c.BI "void \fBfinished\fR ( int code, const QString & source, const QString & description, const QString & help )".br.ti -1c.BI "void \fBstateChanged\fR ( int state )".br.ti -1c.BI "void \fBerror\fR ( int code, const QString & description, int sourcePosition, const QString & sourceText )".br.in -1c.SH DESCRIPTIONThis class is defined in the \fBQt ActiveQt Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main Qt API..PPThe QAxScript class provides a wrapper around script code..PPEvery instance of the QAxScript class represents a piece of scripting code in a particular scripting language. The code is loaded into the script engine using load(). Functions declared in the code can be called using call()..PPThe script provides scriptEngine() provides feedback to the application through signals. The most important signal is the error() signal. Direct access to the QAxScriptEngine is provided through the scriptEngine() function..PP\fBWarning:\fR This class is not available with the bcc5.5 and MingW compilers..SS "Member Type Documentation".SH "QAxScript::FunctionFlags"This FunctionFlags enum describes formatting for function introspection..TP\fCQAxScript::FunctionNames\fR - Only function names are returned..TP\fCQAxScript::FunctionSignatures\fR - Returns the functions with signatures..SH MEMBER FUNCTION DOCUMENTATION.SH "QAxScript::QAxScript ( const QString & name, QAxScriptManager * manager )"Constructs a QAxScript object called \fIname\fR and registers it with the QAxScriptManager \fImanager\fR. This is usually done by the QAxScriptManager class when loading a script..PPA script should always have a name. A manager is necessary to allow the script code to reference objects in the application. The \fImanager\fR takes ownership of the object..SH "QAxScript::~QAxScript ()"Destroys the object, releasing all allocated resources..SH "QVariant QAxScript::call ( const QString & function, const QVariant & var1 = QVariant ( ), const QVariant & var2 = QVariant ( ), const QVariant & var3 = QVariant ( ), const QVariant & var4 = QVariant ( ), const QVariant & var5 = QVariant ( ), const QVariant & var6 = QVariant ( ), const QVariant & var7 = QVariant ( ), const QVariant & var8 = QVariant ( ) )"Calls \fIfunction\fR, passing the parameters \fIvar1\fR, \fIvar1\fR, \fIvar2\fR, \fIvar3\fR, \fIvar4\fR, \fIvar5\fR, \fIvar6\fR, \fIvar7\fR and \fIvar8\fR as arguments and returns the value returned by the function, or an invalid QVariant if the function does not return a value or when the function call failed..PPSee QAxScriptManager::call() for more information about how to call script functions..SH "QVariant QAxScript::call ( const QString & function, QValueList<QVariant> & arguments )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPCalls \fIfunction\fR passing \fIarguments\fR as parameters, and returns the result. Returns when the script's execution has finished..PPSee QAxScriptManager::call() for more information about how to call script functions..SH "void QAxScript::entered ()\fC [signal]\fR"This signal is emitted when a script engine has started executing code..SH "void QAxScript::error ( int code, const QString & description, int sourcePosition, const QString & sourceText )\fC [signal]\fR"This signal is emitted when an execution error occured while running a script..PP\fIcode\fR, \fIdescription\fR, \fIsourcePosition\fR and \fIsourceText\fR contain information about the execution error..SH "void QAxScript::finished ()\fC [signal]\fR"This signal is emitted when a script engine has finished executing code..SH "void QAxScript::finished ( const QVariant & result )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PP\fIresult\fR contains the script's result. This will be an invalid QVariant if the script has no return value..SH "void QAxScript::finished ( int code, const QString & source, const QString & description, const QString & help )\fC [signal]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PP\fIcode\fR, \fIsource\fR, \fIdescription\fR and \fIhelp\fR contain exception information when the script terminated..SH "QStringList QAxScript::functions ( FunctionFlags flags = FunctionNames ) const"Returns a list of all the functions in this script if the respective script engine supports introspection; otherwise returns an empty list. The functions are either provided with full prototypes or only as names, depending on the value of \fIflags\fR..PPSee also QAxScriptEngine::hasIntrospection()..SH "bool QAxScript::load ( const QString & code, const QString & language = QString::null )"Loads the script source \fIcode\fR written in language \fIlanguage\fR into the script engine. Returns TRUE if \fIcode\fR was successfully entered into the script engine; otherwise returns FALSE..PPIf \fIlanguage\fR is empty (the default) it will be determined heuristically. If \fIcode\fR contains the string \fCEnd Sub\fR it will be interpreted as VBScript, otherwise as JScript. Additional scripting languages can be registered using QAxScript::registerEngine()..PPThis function can only be called once for each QAxScript object, which is done automatically when using QAxScriptManager::load()..SH "QString QAxScript::scriptCode () const"Returns the script's code, or the null-string if no code has been loaded yet..PPSee also load()..SH "QAxScriptEngine * QAxScript::scriptEngine () const"Returns a pointer to the script engine..PPYou can use the object returned to connect signals to the script functions, or to access the script engine directly..SH "QString QAxScript::scriptName () const"Returns the name of the script..SH "void QAxScript::stateChanged ( int state )\fC [signal]\fR"This signal is emitted when a script engine changes state.\fIstate\fR can be any value in the QAxScriptEngineState enumeration..SH "SEE ALSO".BR http://doc.trolltech.com/qaxscript.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qaxscript.3qt) and the Qtversion (3.3.5).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -