#include <jsconsolewidget.h>
Inheritance diagram for KJSEmbed::JSConsoleWidget::
Public Slots | |
void | execute () |
virtual bool | execute (const QString &cmd) |
virtual void | println (const QString &text) |
virtual void | warn (const QString &text) |
virtual bool | run (const QString &shellCmd) |
Public Methods | |
JSConsoleWidget (KJS::Interpreter *js, QWidget *parent=0, const char *name=0) | |
virtual | ~JSConsoleWidget () |
KJS::Interpreter * | jscript () const |
QTextEdit * | messages () const |
KPopupTitle * | title () const |
Protected Methods | |
void | createView () |
void | childExited () |
void | receivedStdOutput (KProcess *, char *, int) |
void | receivedStdError (KProcess *, char *, int) |
Creating a JS console is easy, as you can see below:
KJS::Object global( new KJS::ObjectImp() ); KJS::Interpreter *js = new KJS::Interpreter( global ); KJSEmbed::JSConsoleWidget *win = new KJSEmbed::JSConsoleWidget( js ); win->addBindings( js->globalExec(), global );
This example creates a console for a JS interpreter and adds a print function to the interpreter.