qCC  version 2.5.4 (Qt) - 19 Apr. 2014
 All Classes Functions Variables Typedefs Enumerations
Public Slots | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ccConsole Class Reference

Console. More...

#include <ccConsole.h>

Inheritance diagram for ccConsole:
Inheritance graph
[legend]
Collaboration diagram for ccConsole:
Collaboration graph
[legend]

Public Slots

void refresh ()
 Refreshes console (display all messages still in queue)
 

Public Member Functions

void setAutoRefresh (bool state)
 Sets auto-refresh state.
 

Static Public Member Functions

static void Init (QListWidget *textDisplay=0, QWidget *parentWidget=0, MainWindow *parentWindow=0)
 Inits console (and optionaly associates it with a text output widget) More...
 
static ccConsoleTheInstance ()
 Returns the (unique) static instance.
 
static void ReleaseInstance ()
 Releases unique instance.
 

Protected Types

typedef QPair< QString,
MessageLevel > 
ConsoleItemType
 Queue element type (message + color)
 

Protected Member Functions

 ccConsole ()
 Default constructor. More...
 
virtual void displayMessage (const QString &message, MessageLevel level)
 

Protected Attributes

QListWidget * m_textDisplay
 Associated text display widget.
 
QWidget * m_parentWidget
 Parent widget.
 
MainWindowm_parentWindow
 Parent window (if any)
 
QMutex m_mutex
 Mutex for concurrent thread access to console.
 
QVector< ConsoleItemTypem_queue
 Queue for incoming messages.
 
QTimer m_timer
 Timer for auto-refresh.
 

Detailed Description

Console.

Constructor & Destructor Documentation

ccConsole::ccConsole ( )
protected

Default constructor.

Constructor is protected to avoid using this object as a non static class.

Member Function Documentation

void ccConsole::Init ( QListWidget *  textDisplay = 0,
QWidget *  parentWidget = 0,
MainWindow parentWindow = 0 
)
static

Inits console (and optionaly associates it with a text output widget)

WARNING: in release mode, no message will be output if no 'textDisplay' widget is defined. Moreover, error messages will only appear in a (blocking) QMessageBox if a 'parentWidget' widget is defined. In debug mode, all message are sent to system console (with 'printf').

Parameters
textDisplaytext output widget (optional)
parentWidgetparent widget (optional)
parentWindowparent window (if any - optional)

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