Kross
kjsscript.cpp
Go to the documentation of this file.
71 const QString message = QString("%1%2: %3").arg( type ).arg((lineno >= 0) ? QString(" line %1").arg(lineno) : "").arg(value ? value->toString(exec).qstring() : "NULL");
118 krossdebug( QString("KjsScript::addFunctions sender name=%1 className=%2").arg(sender->objectName()).arg(sender->metaObject()->className()) );
132 krosswarning( QString("Failed to publish the QObject name=\"%1\" objectName=\"%2\"").arg(name).arg(object ? object->objectName() : "NULL") );
140 KJSEmbed::QObjectBinding* objImp = KJSEmbed::extractBindingImp<KJSEmbed::QObjectBinding>(exec, obj);
236 QList< QPair<KJS::JSObject*, QPointer<QObject> > >::Iterator it( d->m_publishedObjects.begin() );
237 QList< QPair<KJS::JSObject*, QPointer<QObject> > >::Iterator end( d->m_publishedObjects.end() );
243 KJSEmbed::QObjectBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::QObjectBinding>(exec, kjsobj);
259 krossdebug(QString("KjsScript::finalize published object=%1").arg( kjsobj->className().ascii() ));
284 KJS::UString c = codec ? KJS::UString(codec->toUnicode(code)) : KJS::UString(code.data(), code.size());
326 krossdebug( QString("KjsScript::execute connect function=%1 with signal=%2").arg(name.data()).arg(signature) );
330 KJSEmbed::SlotProxy* receiver = new KJSEmbed::SlotProxy(kjsglobal, exec->dynamicInterpreter(), object, signature.toLatin1());
333 krossdebug( QString("KjsScript::execute connected function=%1 with object=%2 signal=%3").arg(name.data()).arg(object->objectName()).arg(signature) );
336 krosswarning( QString("KjsScript::execute failed to connect object=%1 signal=%2").arg(object->objectName()).arg(signature) );
379 //if( hadError() ) return QVariant(); // check if we had a prev error and abort if that's the case
387 krossdebug(QString("KjsScript::callFunction(\"%1\") Prev error: %2").arg(name).arg(error.errorMessage()));
427 krossdebug(QString("KjsScript::callFunction(\"%1\") Call failed: %2").arg(name).arg(error.errorMessage()));
440 KJS::UString c = codec ? KJS::UString(codec->toUnicode(code)) : KJS::UString(code.data(), code.size());
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
const char * ascii() const
Base class for interpreter dependent functionality each script provides.
Definition: core/script.h:43
virtual QVariant callFunction(const QString &name, const QVariantList &args=QVariantList())
Call a function in the script.
Definition: kjsscript.cpp:377
QHash< QString, Options > objectOptions() const
Definition: childreninterface.h:118
const QObjectList & children() const
bool startsWith(const QByteArray &ba) const
virtual const QMetaObject * metaObject() const
KjsScript(Kross::Interpreter *interpreter, Kross::Action *action)
Constructor.
Definition: kjsscript.cpp:162
QTextCodec * codecForLocale()
virtual QVariant evaluate(const QByteArray &code)
Evaluate some scripting code.
Definition: kjsscript.cpp:437
const char * name() const
int indexOf(char ch, int from) const
const QString errorMessage() const
Definition: errorinterface.h:53
QHash< QString, QObject * > objects() const
Definition: childreninterface.h:104
objectName
bool isEmpty() const
int methodCount() const
Interface for managing Object collections.
Definition: childreninterface.h:38
iterator begin()
const char * signature() const
Item next()
const char * className() const
QObject * object(const QString &name) const
Definition: childreninterface.h:97
MethodType methodType() const
auto connect signals with scripting functions.
Definition: childreninterface.h:47
QByteArray toLatin1() const
void setError(const QString &errormessage, const QString &tracemessage=QString(), long lineno=-1)
Set the error message.
Definition: errorinterface.h:69
char * data()
QString left(int n) const
static ErrorInterface extractError(const KJS::Completion &completion, KJS::ExecState *exec)
Extract an errormessage from a KJS::Completion object.
Definition: kjsscript.cpp:49
The Action class is an abstract container to deal with scripts like a single standalone script file...
Definition: action.h:94
iterator end()
int size() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QByteArray & remove(int pos, int len)
const KShortcut & end()
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
const KShortcut & completion()
QMetaMethod method(int index) const
QString toUnicode(const QByteArray &a) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.