#include <logtreewidget.h>
Public Types | |
TimeColumn = 0 | |
TypeColumn = 1 | |
MessageColumn = 2 | |
enum | LogColumns { TimeColumn = 0, TypeColumn = 1, MessageColumn = 2 } |
Public Slots | |
void | clearMessages () |
Public Member Functions | |
LogTreeWidget (QWidget *parent=0) | |
QStringList | selectedMessages () |
QStringList | allMessages () |
void | deselectAll () |
int | messageCount () |
void | setMaximumMessageCount (int max) |
void | filter (uint filter) |
LogTreeItem * | log (LogEvent::Severity type, QString message) |
QList< LogTreeItem * > | find (QString text, bool highlight=true) |
Protected Member Functions | |
void | showEvent (QShowEvent *event) |
Private Slots | |
void | verticalSliderReleased () |
Private Member Functions | |
void | addLogTreeItem (LogTreeItem *item) |
QList< LogTreeItem * > | qlist_cast (QList< QTreeWidgetItem * > inlist) |
QList< LogTreeItem * > | qlist_sort (QList< LogTreeItem * > inlist) |
Private Attributes | |
QList< LogTreeItem * > | _itemHistory |
int | _maxItemCount |
bool | _scrollOnNewItem |
Definition at line 31 of file logtreewidget.h.
Log tree column indices.
TimeColumn | Timestamp column. |
TypeColumn | Message severity type column. |
MessageColumn | Message text column. |
Definition at line 37 of file logtreewidget.h.
LogTreeWidget::LogTreeWidget | ( | QWidget * | parent = 0 |
) |
Default constructor.
Definition at line 25 of file logtreewidget.cpp.
References _scrollOnNewItem, MessageColumn, TimeColumn, and verticalSliderReleased().
void LogTreeWidget::addLogTreeItem | ( | LogTreeItem * | item | ) | [private] |
Adds item as a top-level item in the tree.
Definition at line 225 of file logtreewidget.cpp.
References _itemHistory.
Referenced by log().
QStringList LogTreeWidget::allMessages | ( | ) |
Returns a list of all messages in the tree.
Definition at line 127 of file logtreewidget.cpp.
References _itemHistory, and LogTreeItem::toString().
void LogTreeWidget::clearMessages | ( | ) | [slot] |
Clears all contents on the message log and resets the counter.
Definition at line 101 of file logtreewidget.cpp.
References _itemHistory.
void LogTreeWidget::deselectAll | ( | ) |
Deselects all currently selected messages.
Definition at line 161 of file logtreewidget.cpp.
Referenced by find().
void LogTreeWidget::filter | ( | uint | filter | ) |
Filters the log according to the specified filter.
Definition at line 233 of file logtreewidget.cpp.
References _itemHistory, _maxItemCount, and i().
QList< LogTreeItem * > LogTreeWidget::find | ( | QString | text, | |
bool | highlight = true | |||
) |
Searches the log for entries that contain the given text.
Definition at line 251 of file logtreewidget.cpp.
References deselectAll(), MessageColumn, qlist_cast(), and qlist_sort().
LogTreeItem * LogTreeWidget::log | ( | LogEvent::Severity | type, | |
QString | message | |||
) |
Adds a log item to the tree.
Definition at line 170 of file logtreewidget.cpp.
References _itemHistory, _maxItemCount, _scrollOnNewItem, addLogTreeItem(), messageCount(), and TimeColumn.
int LogTreeWidget::messageCount | ( | ) |
Returns the number of items currently in the tree.
Definition at line 140 of file logtreewidget.cpp.
Referenced by log(), and setMaximumMessageCount().
QList< LogTreeItem * > LogTreeWidget::qlist_cast | ( | QList< QTreeWidgetItem * > | inlist | ) | [private] |
Casts a QList of one pointer type to another.
Definition at line 64 of file logtreewidget.cpp.
Referenced by find(), and selectedMessages().
QList< LogTreeItem * > LogTreeWidget::qlist_sort | ( | QList< LogTreeItem * > | inlist | ) | [private] |
Sortrs a QList of pointers to tree items. List of pointers to all log message items currently in the tree.
Definition at line 75 of file logtreewidget.cpp.
References LogTreeItem::id().
Referenced by find(), and selectedMessages().
QStringList LogTreeWidget::selectedMessages | ( | ) |
Returns a list of all currently selected messages.
Definition at line 110 of file logtreewidget.cpp.
References qlist_cast(), qlist_sort(), and LogTreeItem::toString().
void LogTreeWidget::setMaximumMessageCount | ( | int | max | ) |
Sets the maximum number of items in the tree.
Definition at line 147 of file logtreewidget.cpp.
References _itemHistory, _maxItemCount, and messageCount().
void LogTreeWidget::showEvent | ( | QShowEvent * | event | ) | [protected] |
Sets the default, initial column header widths.
Definition at line 87 of file logtreewidget.cpp.
void LogTreeWidget::verticalSliderReleased | ( | ) | [private, slot] |
Called when the user moves the vertical scroll bar.
Definition at line 52 of file logtreewidget.cpp.
References _scrollOnNewItem.
Referenced by LogTreeWidget().
QList<LogTreeItem *> LogTreeWidget::_itemHistory [private] |
Definition at line 87 of file logtreewidget.h.
Referenced by addLogTreeItem(), allMessages(), clearMessages(), filter(), log(), and setMaximumMessageCount().
int LogTreeWidget::_maxItemCount [private] |
Maximum number of items in the tree.
Definition at line 88 of file logtreewidget.h.
Referenced by filter(), log(), and setMaximumMessageCount().
bool LogTreeWidget::_scrollOnNewItem [private] |
Set to true if we are to scroll to the new item after adding a message to the log.
Definition at line 89 of file logtreewidget.h.
Referenced by log(), LogTreeWidget(), and verticalSliderReleased().