LogTreeWidget Class Reference

#include <LogTreeWidget.h>

List of all members.

Public Types

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)
LogTreeItemlog (tc::Severity severity, const 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

Detailed Description

Definition at line 32 of file LogTreeWidget.h.


Member Enumeration Documentation

Log tree column indices.

Enumerator:
TimeColumn 

Timestamp column.

TypeColumn 

Message severity type column.

MessageColumn 

Message text column.

Definition at line 38 of file LogTreeWidget.h.


Constructor & Destructor Documentation

LogTreeWidget::LogTreeWidget ( QWidget *  parent = 0  ) 

Default constructor.

Definition at line 25 of file LogTreeWidget.cpp.

References _scrollOnNewItem, MessageColumn, TimeColumn, and verticalSliderReleased().


Member Function Documentation

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.

Returns a list of all items 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.

Clears all items from the message log and resets the counter in the status bar.

Definition at line 101 of file LogTreeWidget.cpp.

References _itemHistory.

void LogTreeWidget::deselectAll (  ) 

Deselects all currently selected messages.

Deselects all currently selected items.

Definition at line 161 of file LogTreeWidget.cpp.

Referenced by find().

void LogTreeWidget::filter ( uint  filter  ) 

Filters the log according to the specified filter.

Filters the message log based on the given filter.

Definition at line 233 of file LogTreeWidget.cpp.

References _itemHistory, _maxItemCount, i(), and LogTreeItem::severity().

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 ( tc::Severity  type,
const QString &  message 
)

Adds a log item to the tree.

Adds a log item to the tree and returns a pointer to the new item.

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.

Returns the number of items currently shown.

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.

Cast a QList of QTreeWidgetItem pointers to a list of LogTreeWidget pointers. There really must be a better way to do this.

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.

Sorts the list of pointers to log tree items by timestamp.

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.

Returns a list of all currently selected items.

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.

The first time the log tree is shown, we need to set the default column widths.

Definition at line 87 of file LogTreeWidget.cpp.

void LogTreeWidget::verticalSliderReleased (  )  [private, slot]

Called when the user moves the vertical scroll bar.

Called when the user moves the vertical scrollbar. If the user has the scrollbar at within one step of its maximum, then always scroll to new items when added. Otherwise, leave the scrollbar alone since they are probably looking at something in their history.

Definition at line 52 of file LogTreeWidget.cpp.

References _scrollOnNewItem.

Referenced by LogTreeWidget().


Member Data Documentation

Maximum number of items in the tree.

Definition at line 89 of file LogTreeWidget.h.

Referenced by filter(), log(), and setMaximumMessageCount().

Set to true if we are to scroll to the new item after adding a message to the log.

Definition at line 90 of file LogTreeWidget.h.

Referenced by log(), LogTreeWidget(), and verticalSliderReleased().


The documentation for this class was generated from the following files:
Generated on Mon Aug 30 22:58:56 2010 for Vidalia by  doxygen 1.6.3