SynchroTime
Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Console Class Reference

The Console class. More...

#include <console.h>

Inheritance diagram for Console:
Inheritance graph
Collaboration diagram for Console:
Collaboration graph

Signals

void getData (const QByteArray &data)
 

Public Member Functions

 Console (QWidget *parent=0)
 Console::Console. More...
 
 ~Console ()
 Console::~Console. More...
 
void putData (const QString &data)
 Console::putData. More...
 
void setLocalEchoEnabled (bool set)
 Console::setLocalEchoEnabled. More...
 

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *e)
 Console::keyPressEvent. More...
 
virtual void mousePressEvent (QMouseEvent *e)
 Console::mousePressEvent. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *e)
 Console::mouseDoubleClickEvent. More...
 
virtual void contextMenuEvent (QContextMenuEvent *e)
 Console::contextMenuEvent. More...
 

Private Member Functions

const QString formatHtml (const QString &qText, const QColor &qColor=QColor(Qt::green)) const
 Console::formatHtml. More...
 

Private Attributes

bool localEchoEnabled
 
QByteArray * buffer
 

Detailed Description

The Console class.

Provides the user with methods for the console interface.

Constructor & Destructor Documentation

Console::Console ( QWidget *  parent = 0)
explicit

Console::Console.

Standard constructor

Parameters
parentof the type *QWidget - main application window (*MainWindow)

References buffer.

Console::~Console ( )

Console::~Console.

Default destructor

References buffer.

Member Function Documentation

void Console::contextMenuEvent ( QContextMenuEvent *  e)
protectedvirtual
const QString Console::formatHtml ( const QString &  qText,
const QColor &  qColor = QColor(Qt::green) 
) const
private

Console::formatHtml.

This helper function solves the formatting problem. The problem is that plain text can contain special characters that have meta-values in HTML, literally: <> & "'. This is solved by a simple formatter that converts them to their corresponding HTML entities. For example, the function converts the end of the line "\ n" to "<br/>".

Parameters
qTextof the type const QString. Block of text to convert to HTML.
qColorof the type const QColor. The color for the block of text.
Returns
qHtmlText of the type const QString.

Referenced by putData().

Here is the caller graph for this function:

void Console::getData ( const QByteArray &  data)
signal

Referenced by keyPressEvent().

Here is the caller graph for this function:

void Console::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Console::keyPressEvent.

Parameters
e

References buffer, getData(), and localEchoEnabled.

void Console::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual
void Console::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Console::mousePressEvent.

Parameters
e
void Console::putData ( const QString &  data)

Console::putData.

The function displays text in the console window, while converting escape sequences '\x1B' to colored HTML text.

Parameters
dataof the type const QString. Incoming paint-text.

References ESC_END, ESC_START, and formatHtml().

Referenced by MainWindow::connectRTC().

Here is the call graph for this function:

Here is the caller graph for this function:

void Console::setLocalEchoEnabled ( bool  set)

Console::setLocalEchoEnabled.

Parameters
setof the type bool.

References localEchoEnabled.

Member Data Documentation

QByteArray* Console::buffer
private

Referenced by Console(), keyPressEvent(), and ~Console().

bool Console::localEchoEnabled
private

The documentation for this class was generated from the following files: