39 #include "boost/shared_ptr.hpp"
44 #include <QTextStream>
46 #include <QApplication>
57 mMessageLevel(messageLevel),
58 mTimeoutTime(timeoutTime),
59 mTimeStamp(QDateTime::currentDateTime()),
63 this->setThreadName();
71 void Message::setThreadName()
73 if (QApplication::instance()->thread() == QThread::currentThread())
77 mThread = QThread::currentThread()->objectName();
79 mThread =
"0x"+QString::number(reinterpret_cast<long>(QThread::currentThreadId()), 16);
87 QString printableMessage;
89 printableMessage =
mText;
91 printableMessage = QString(
"[%1][%2] %3")
102 return printableMessage;
QString qstring_cast(const T &val)
Message(QString text="", MESSAGE_LEVEL messageLevel=mlDEBUG, int timeoutTime=-1)
QString getPrintableMessage() const
Text containing information appropriate to display.
QString getText() const
The raw message.
int getTimeout() const
Timout tells the statusbar how long it should be displayed, this depends on the message level...
QDateTime getTimeStamp() const
The time at which the message was created.
MESSAGE_LEVEL mMessageLevel
QString getSourceLocation() const
MESSAGE_LEVEL getMessageLevel() const
The category of the message.