• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Kross

  • Kross
  • EcmaScript
Public Slots | Public Member Functions | List of all members
Kross::EcmaScript Class Reference

#include <script.h>

Inheritance diagram for Kross::EcmaScript:
Kross::Script QObject Kross::ErrorInterface

Public Slots

virtual QVariant callFunction (const QString &name, const QVariantList &args=QVariantList())
QObject * engine () const
virtual QVariant evaluate (const QByteArray &code)
virtual void execute ()
virtual QStringList functionNames ()
Public Slots inherited from Kross::Script
Action * action () const
virtual QVariant callFunction (const QString &name, const QVariantList &args=QVariantList())=0
virtual QVariant evaluate (const QByteArray &code)=0
virtual void execute ()=0
virtual QStringList functionNames ()=0
Interpreter * interpreter () const

Public Member Functions

 EcmaScript (Kross::Interpreter *interpreter, Kross::Action *action)
virtual ~EcmaScript ()
Public Member Functions inherited from Kross::Script
 Script (Interpreter *interpreter, Action *action)
virtual ~Script ()
Public Member Functions inherited from Kross::ErrorInterface
 ErrorInterface ()
void clearError ()
long errorLineNo () const
const QString errorMessage () const
const QString errorTrace () const
bool hadError () const
void setError (const QString &errormessage, const QString &tracemessage=QString(), long lineno=-1)
void setError (ErrorInterface *error)

Detailed Description

The EcmaScript class implements a Kross::Script to handle a single script.

Each script and script file will have its own EcmaScript instance as container for a Ecma QtScript that is managed by the Kross::Action class.

Definition at line 38 of file qts/script.h.

Constructor & Destructor Documentation

◆ EcmaScript()

EcmaScript::EcmaScript ( Kross::Interpreter * interpreter,
Kross::Action * action )

Constructor.

Parameters
interpreterThe EcmaInterpreter instance this script belongs to.
actionThe Kross::Action instance that contains details about the script and that decorates this script.

Definition at line 167 of file qts/script.cpp.

◆ ~EcmaScript()

EcmaScript::~EcmaScript ( )
virtual

Destructor.

Definition at line 172 of file qts/script.cpp.

Member Function Documentation

◆ callFunction

QVariant EcmaScript::callFunction ( const QString & name,
const QVariantList & args = QVariantList() )
virtualslot

Execute a function.

Parameters
nameThe name of the function that should be called.
argsThe optional arguments for the function.
Returns
The return value of the function.

Definition at line 227 of file qts/script.cpp.

◆ engine

QObject * EcmaScript::engine ( ) const
slot
Returns
the internal used QScriptEngine instance.

Definition at line 269 of file qts/script.cpp.

◆ evaluate

QVariant EcmaScript::evaluate ( const QByteArray & code)
virtualslot

Evaluate some scripting code.

Parameters
codeThe scripting code to evaluate.
Returns
The return value of the evaluation.

Definition at line 254 of file qts/script.cpp.

◆ execute

void EcmaScript::execute ( )
virtualslot

Executes the script.

Definition at line 178 of file qts/script.cpp.

◆ functionNames

QStringList EcmaScript::functionNames ( )
virtualslot
Returns
a list of function-names.

Definition at line 210 of file qts/script.cpp.


The documentation for this class was generated from the following files:
  • qts/script.h
  • qts/script.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal