Console.
More...
#include <ccConsole.h>
|
| ~ccConsole () override |
| Destructor.
|
|
void | setAutoRefresh (bool state) |
| Sets auto-refresh state.
|
|
bool | setLogFile (const QString &filename) |
| Sets log file.
|
|
QWidget * | parentWidget () |
| Returns the parent widget (if any)
|
|
void | refresh () |
| Refreshes console (display all messages still in queue)
|
|
|
static void | Init (QListWidget *textDisplay=nullptr, QWidget *parentWidget=nullptr, MainWindow *parentWindow=nullptr, bool redirectToStdOut=false) |
| Inits console (and optionaly associates it with a text output widget) More...
|
|
static ccConsole * | TheInstance (bool autoInit=true) |
| Returns the (unique) static instance. More...
|
|
static void | ReleaseInstance (bool flush=true) |
| Releases unique instance.
|
|
static void | EnableQtMessages (bool state) |
| Whether to show Qt messages (qDebug / qWarning / etc.) in Console.
|
|
static bool | QtMessagesEnabled () |
| Returns whether to show Qt messages (qDebug / qWarning / etc.) in Console or not.
|
|
|
using | ConsoleItemType = QPair< QString, int > |
| Queue element type (message + color)
|
|
|
| ccConsole () |
| Default constructor. More...
|
|
void | logMessage (const QString &message, int level) override |
|
|
QListWidget * | m_textDisplay |
| Associated text display widget.
|
|
QWidget * | m_parentWidget |
| Parent widget.
|
|
MainWindow * | m_parentWindow |
| Parent window (if any)
|
|
QMutex | m_mutex |
| Mutex for concurrent thread access to console.
|
|
QVector< ConsoleItemType > | m_queue |
| Queue for incoming messages.
|
|
QTimer | m_timer |
| Timer for auto-refresh.
|
|
QFile | m_logFile |
| Log file.
|
|
QTextStream * | m_logStream |
| Log file stream.
|
|
|
static bool | s_showQtMessagesInConsole = false |
| Whether to show Qt messages (qDebug / qWarning / etc.) in Console.
|
|
static bool | s_redirectToStdOut = false |
|
◆ ccConsole()
Default constructor.
Constructor is protected to avoid using this object as a non static class.
◆ Init()
void ccConsole::Init |
( |
QListWidget * |
textDisplay = nullptr , |
|
|
QWidget * |
parentWidget = nullptr , |
|
|
MainWindow * |
parentWindow = nullptr , |
|
|
bool |
redirectToStdOut = false |
|
) |
| |
|
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
-
textDisplay | text output widget (optional) |
parentWidget | parent widget (optional) |
parentWindow | parent window (if any - optional) |
redirectToStdOut | whether to redirect log messages to the system std::out output or not (optional) |
◆ TheInstance()
ccConsole * ccConsole::TheInstance |
( |
bool |
autoInit = true | ) |
|
|
static |
Returns the (unique) static instance.
- Parameters
-
autoInit | automatically initialize the console instance (with no widget!) if not done already |
The documentation for this class was generated from the following files:
- ccConsole.h
- ccConsole.cpp