Console Widget. More...

#include <qrconsole.h>

Inheritance diagram for QRConsole:
[legend]
Collaboration diagram for QRConsole:
[legend]

Signals

void EnterCmd (QString cmd)
 

Public Member Functions

virtual void keyPressEvent (QKeyEvent *e)
 
 QRConsole (QWidget *parent)
 
virtual void WriteError (const RString &str)
 
virtual void WriteStr (const RString &str)
 
 ~QRConsole (void)
 
- Public Member Functions inherited from RPrgOutput
 RPrgOutput (void)
 
virtual ~RPrgOutput (void)
 

Private Attributes

QList< QString > Cmds
 
QTextCursor Cursor
 
int Pos
 

Detailed Description

Console Widget.

The RQConsole class provides a Qt widget that simulates a console. It maintains a list of the last 100 different commands entered. The up and down keys are used to navigate through the history.

In particular, this widget can be used in interaction with a RInterpreter instance.

Constructor & Destructor Documentation

QRConsole ( QWidget *  parent)

Construct the console.

Parameters
parentParent widget.
~QRConsole ( void  )

Member Function Documentation

virtual void keyPressEvent ( QKeyEvent *  e)
virtual

Catch the key event to simulate a real console.

Parameters
eEvent.
virtual void WriteStr ( const RString str)
virtual

Write some messages.

Parameters
strMessage to print.

Reimplemented from RPrgOutput.

virtual void WriteError ( const RString str)
virtual

Write some error messages. The message is displayed in red.

Parameters
strMessage to print.
void EnterCmd ( QString  cmd)
signal

Signal emits when a command was entered.

Member Data Documentation

QTextCursor Cursor
private

Current cursor.

QList<QString> Cmds
private

Previous commands.

int Pos
private

Position in the list.