#include <logtreeitem.h>
Public Member Functions | |
LogTreeItem (LogEvent::Severity type, QString message, QDateTime timestamp=QDateTime::currentDateTime()) | |
void | setTimestamp (QDateTime timestamp) |
void | setSeverity (LogEvent::Severity type) |
void | setMessage (QString message) |
quint32 | id () const |
QDateTime | timestamp () const |
LogEvent::Severity | severity () const |
QString | message () const |
QString | toString () const |
virtual bool | operator< (const QTreeWidgetItem &other) const |
Private Attributes | |
quint32 | _seqnum |
Definition at line 37 of file logtreeitem.h.
LogTreeItem::LogTreeItem | ( | LogEvent::Severity | type, | |
QString | message, | |||
QDateTime | timestamp = QDateTime::currentDateTime() | |||
) |
Default constructor.
Definition at line 44 of file logtreeitem.cpp.
References _seqnum, setMessage(), setSeverity(), and setTimestamp().
void LogTreeItem::setTimestamp | ( | QDateTime | timestamp | ) |
Sets the item's log time.
Definition at line 71 of file logtreeitem.cpp.
References COL_TIME, and DATETIME_FMT.
Referenced by LogTreeItem().
void LogTreeItem::setSeverity | ( | LogEvent::Severity | type | ) |
Sets the item's severity and appropriate background color.
Sets the item's severity and the appropriate background color.
Definition at line 80 of file logtreeitem.cpp.
References COL_TYPE, LogEvent::Error, i(), ROLE_TYPE, LogEvent::severityToString(), and LogEvent::Warn.
Referenced by LogTreeItem().
void LogTreeItem::setMessage | ( | QString | message | ) |
Sets the item's message text.
Definition at line 103 of file logtreeitem.cpp.
References COL_MESG, and string_wrap().
Referenced by LogTreeItem().
quint32 LogTreeItem::id | ( | ) | const [inline] |
Returns this message's sequence number.
Definition at line 52 of file logtreeitem.h.
References _seqnum.
Referenced by LogTreeWidget::qlist_sort().
QDateTime LogTreeItem::timestamp | ( | ) | const |
Returns the timestamp for this log message.
Definition at line 118 of file logtreeitem.cpp.
References COL_TIME, and DATETIME_FMT.
LogEvent::Severity LogTreeItem::severity | ( | ) | const |
Returns the severity associated with this log item.
Definition at line 111 of file logtreeitem.cpp.
References COL_TYPE, and ROLE_TYPE.
Referenced by LogTreeWidget::filter(), and operator<().
QString LogTreeItem::message | ( | ) | const |
Returns the message associated with this log item.
Returns the message for this log item.
Definition at line 125 of file logtreeitem.cpp.
References COL_MESG.
Referenced by operator<().
QString LogTreeItem::toString | ( | ) | const |
Returns a printable string representation of the item's contents.
Returns a printable string representing the fields of this item.
Definition at line 62 of file logtreeitem.cpp.
References COL_MESG, COL_TIME, and COL_TYPE.
Referenced by LogTreeWidget::allMessages(), MessageLog::log(), and LogTreeWidget::selectedMessages().
bool LogTreeItem::operator< | ( | const QTreeWidgetItem & | other | ) | const [virtual] |
Compares other to this log message item based on the current sort column and order.
Compares other to this log message item based on the current sort column.
Definition at line 133 of file logtreeitem.cpp.
References _seqnum, COL_TIME, COL_TYPE, message(), and severity().
quint32 LogTreeItem::_seqnum [private] |
Sequence number used to disambiguate messages with the same timestamp.
Definition at line 67 of file logtreeitem.h.
Referenced by id(), LogTreeItem(), and operator<().