LibEngsas
Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ELogObject Class Reference

Creates a QDockWidget and collects all errors, warnings and information. More...

#include <elogobject.h>

+ Inheritance diagram for ELogObject:
+ Collaboration diagram for ELogObject:

Signals

void addMessage (QtMsgType type, const QString msg)
- Signals inherited from EObject
void error (const QString &message)
void warning (const QString &message)
void information (const QString &message)
void reloadEnableActions ()
 Request reloading of enabled actions in EMainWindow.
void addMenu (QMenu *newMenu, const QString &parent, QString before=QString())
void addAction (QAction *newAction, const QString &parent, QString before=QString())
void addToolBar (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
void addNewDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area)
void setCentralWidget (QWidget *centralWidget)
void showSettings ()
void showHelp (const QString &page)
void showStatusWidget (QWidget *widget)
void reloadSettingsRequest ()
 Indicates, that a reload of the settings is needed.
void doReloadSettings ()
 Emitted to bring the reload request back to the farest child.

Public Member Functions

 ELogObject (bool installMessageHandler, QObject *parent=NULL)
 ~ELogObject ()
void init (QString filePath=QString())
 Set's up the log object.
void setup (EObject *object)
void setup (EWidget *object)
- Public Member Functions inherited from EObject
 EObject (QObject *parent=0)
virtual ~EObject ()
void connectByPass (QObject *object)

Static Public Member Functions

static void messageHandler (QtMsgType type, const char *msg)
 Used to fetch the messages of qDebug(), qWarning(), qCritical() and qFatal().
- Static Public Member Functions inherited from EObject
static void connectByPass (QObject *parent, QObject *child)

Private Member Functions

void populateMessage (QtMsgType type, const QString msg)

Private Attributes

ELogObjectPrivatelogger
bool installedAsMessageHandler

Static Private Attributes

static ELogObjectself = NULL

Additional Inherited Members

- Public Slots inherited from EObject
virtual void reloadSettings ()
 Used to reload the settings.
- Protected Slots inherited from EObject
virtual void errorByPass (const QString &message)
virtual void warningByPass (const QString &message)
virtual void informationByPass (const QString &message)
virtual void reloadEnableActionsByPass ()
virtual void addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString())
virtual void addActionByPass (QAction *newAction, const QString &parent, QString before=QString())
virtual void addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
virtual void addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area)
virtual void setCentralWidgetByPass (QWidget *centralWidget)
virtual void showSettingsByPass ()
virtual void showHelpByPass (const QString &page)
virtual void showStatusWidgetByPass (QWidget *widget)
virtual void reloadSettingsRequestByPass ()
- Protected Member Functions inherited from EObject
void addManagedDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area, QString actionLabel=QString(), QString actionParent=QString())
 Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets.

Detailed Description

Creates a QDockWidget and collects all errors, warnings and information.

The object, where the warnings, errors and information are collected from, can be set with setup(EObject*) or setup(EWidget*). If you want to catch all qDebug(), qWarning(), qCritical() and qFatal() outputs, call ELogObject() with first argument set to true, to install this object as a message handler.

To log to a file instead of the log widget, specify the file path as first parameter of init().

Note
The message "This application has requested the Runtime to terminate it in an unusual way." appearing when qFatal() is used, is caused by calling abort(). This is not an error of this class.
See Also
messageHandler()

Constructor & Destructor Documentation

ELogObject::ELogObject ( bool  installMessageHandler,
QObject *  parent = NULL 
)
ELogObject::~ELogObject ( )

Member Function Documentation

void ELogObject::addMessage ( QtMsgType  type,
const QString  msg 
)
signal

+ Here is the caller graph for this function:

void ELogObject::init ( QString  filePath = QString())

Set's up the log object.

To log to a file, specifiy the log file file path with filePath. If empty, it is logged to a QTextEdit in an QDockWidget.

+ Here is the call graph for this function:

void ELogObject::messageHandler ( QtMsgType  type,
const char *  msg 
)
static

Used to fetch the messages of qDebug(), qWarning(), qCritical() and qFatal().

To install it, just call ELogObject() with first argument set to true.

void ELogObject::populateMessage ( QtMsgType  type,
const QString  msg 
)
private

+ Here is the call graph for this function:

void ELogObject::setup ( EObject object)

+ Here is the call graph for this function:

void ELogObject::setup ( EWidget object)

+ Here is the call graph for this function:

Member Data Documentation

bool ELogObject::installedAsMessageHandler
private
ELogObjectPrivate* ELogObject::logger
private
ELogObject * ELogObject::self = NULL
staticprivate

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