![]() |
Carousel
|
It is a defaul implementation of the IScriptConsole. More...
#include <ScriptConsole.h>
Inherits IScriptConsole.
Public Member Functions | |
ScriptConsole (QObject *parent=nullptr) | |
ScriptConsole (QScriptEngine *engine, QObject *parent=nullptr) | |
const QStringList & | commandHistory () const |
QScriptEngine * | engine () |
int | historyCapacity () const |
void | setHistoryCapacity (int capacity) |
![]() | |
IScriptConsole () | |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
![]() | |
IOutputHandler () | |
virtual void | print (const QString &message)=0 |
Additional Inherited Members | |
![]() | |
virtual bool | execCommand (const QString &command)=0 |
virtual QString | nextCommand ()=0 |
virtual QString | prevCommand ()=0 |
![]() | |
void | aboutToExecute (const QString &command) |
void | error (const QString &error) |
void | printed (const QString &message) |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
QStringList | commandHistory |
int | historyCapacity |
![]() | |
objectName | |
It is a defaul implementation of the IScriptConsole.
There are methods similiar to the just a console or terminal - execute command and command history. But this object does not pretend for visualizatoin, there is the ScriptConsoleView for this purpose.
Also, when this interface is implemented, an IOutputHandler one should be implemented too to be able to redirect print() functions to the console printed() signal.
You can get reference to the IScriptConsole using
|
explicit |
Initializes a new instance of the ScriptConsole class using defaul QScriptEngine as an engine for command execution.
|
explicit |
Initializes a new instance of the ScriptConsole class using specified engine for command execution.
Note, that it takes ownership for engine.
|
virtual |
Gets an script engine, that executes commands. See IScriptExtension extension, if you want to extend script engine in more common way.
Implements IScriptConsole.
|
virtual |
Gets a maximum amount of commands, stored in the history collection. When current size reaches this amount, further execCommand() calls will remove oldest command from the history.
Implements IScriptConsole.
|
virtual |
Sets a maximum amount of commands, stored in the history collection.
Implements IScriptConsole.
|
virtual |
Gets all executed commands on this console.
Implements IScriptConsole.