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

kjsembed

KJSEmbed

Provides a method of binding JavaScript objects to QObjects, so you can script your applications.The KJSEmbed::Engine class does provide the main interface for running embedded Javascript.

KJSEmbed::Engine *engine = new KJSEmbed::Engine();
KJS::Interpreter *interpreter = engine->interpreter();
interpreter->setShouldPrintExceptions(true);
KJS::ExecState *exec = interpreter->globalExec();
KJS::UString code("print(\"Hello World\")");
KJSEmbed::Engine::ExitStatus exitstatus = engine->execute(code);
KJS::Completion completion = engine->completion();
if(exitstatus != KJSEmbed::Engine::Success) {
KJS::JSValue* value = completion.value();
qDebug() << value->toString(exec).qstring();
}
See also
http://websvn.kde.org/trunk/KDE/kdelibs/kjs
http://websvn.kde.org/trunk/KDE/kdelibs/kjsembed
http://websvn.kde.org/trunk/KDE/kdelibs/kross/kjs
Author
Ian Reinhart Geiser (geise.nosp@m.ri@k.nosp@m.de.or.nosp@m.g)
Matt Broadstone (mbroa.nosp@m.dst@.nosp@m.gmail.nosp@m..com)
Richard J. Moore (rich@.nosp@m.kde..nosp@m.org)
Erik L. Bunce (kde@b.nosp@m.unce.nosp@m..us)
Sebastian Sauer (mail@.nosp@m.dipe.nosp@m..org)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjsembed

Skip menu "kjsembed"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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