|Home | Tutorial | Classes | Functions | QSA Workbench | Language | Qt API | QSA Articles | Qt Script for Applications | ![]() |
The QSScript class provides encapsulation of a script written in Qt Script. More...
#include <qsscript.h>
The QSScript class provides encapsulation of a script written in Qt Script.
A script is a container for a script written in Qt Script. It always belongs to a project and it can only be created using the QSProject::createScript() functions. The QSScript can be associated with a QObject which will serve as the context ( this ) when the script is evaluated. QSScripts and their contexts, if any, are associated by name as follows:
script->name() == script->context()->name()
Use the functions setCode(), addCode(), and addFunction() to modify the contents of the script. Use the function code() to retreive the contents in the script. When the script is changed, the signal codeChanged() is emitted.
The code for the function can be passed in the functionBody parameter. If functionBody was specified, its text will appear in the editor; if the functionBody is empty a new empty function will be created.
This function returns TRUE on success (i.e. the functionName was valid); otherwise returns FALSE.
This signal is emitted whenever the scriptcode has changed.
The name of the context context()->name() is to be the same name as this script.
This file is part of Qt Script for Applications, copyright © 2001-2004 Trolltech. All Rights Reserved.
Copyright © 2001-2006 Trolltech | Trademarks | QSA version 1.1.5
|