Commit 0fa9a846 authored by Robert Frohl's avatar Robert Frohl

[DOC][ADD] - event log shows always the newest event

parent 43f21fc7
......@@ -199,6 +199,7 @@ void WQtStatusBar::createLogEntry( const WLogEntry& entry )
m_model->appendRow( entryRow );
m_view->resizeColumnsToContents();
m_view->horizontalHeader()->setStretchLastSection( true );
m_view->scrollToBottom();
}
void WQtStatusBar::logLevelChanged( int logLevel )
......
......@@ -36,9 +36,9 @@
#include "guiElements/WQtStatusIcon.h"
/**
* The status bar at the bottom of the main window, displays messages and
* with the help of a colored circle ifany errors or warnings occure during the
* use of OpenWalnut
* The status bar at the bottom of the main window, displays messages severity.
* Different colors are used to indicate what type of message occured during the
* use of OpenWalnut.
**/
class WQtStatusBar : public QStatusBar
{
......@@ -75,38 +75,40 @@ class WQtStatusBar : public QStatusBar
private:
/**
* pointer to the "trafic light" element in the bottom left corner of the status bar.
* Pointer to the "trafic light" element in the bottom left corner of the status bar.
* Indicator for the 'severest' event that occured.
**/
WQtStatusIcon *m_statusIcon;
/**
* pointer to the label in the status bar, displaying the the newest
* and the severest message at that point in time.
* Pointer to the label in the status bar, displaying the severest message and its origin.
**/
QLabel *m_label;
/**
* the standard item model holding the event data.
* The standard item model holding the event data log.
* Used to display the event log table.
**/
QStandardItemModel *m_model;
/**
* table view that displays the model.
* Table view that displays the model.
**/
QTableView *m_view;
/**
* used to filter the content of the model
* Used to filter the content of the model by severity of the log message.
**/
QSortFilterProxyModel *m_filter;
/**
* contains log and combo box to decide what is displayed
* Contains log table (the table view) and combo box (to interact with the filter)
* to decide what kind of message is displayed in the log table.
**/
QWidget *m_logWidget;
/**
* creates a new entry in the QStandardItemModel, represented by one row in the QTableView.
* Creates a new entry in the QStandardItemModel, represented by one row in the QTableView.
*
* \param entry the entry from whom the new row is created
**/
......@@ -114,9 +116,9 @@ class WQtStatusBar : public QStatusBar
private slots:
/**
* gets called when the log level is changed in the log widget (through the combo box)
* Gets called when the log level is changed in the log widget (through the combo box)
*
* \param logLevel the new log level
* \param logLevel the new log level for the filter
**/
void logLevelChanged( int logLevel );
};
......
......@@ -29,28 +29,36 @@
#include "../../../common/WLogEntry.h"
/**
* This event is triggered when a new event is to be added to the log, displayed by the WQtStatusBar.
**/
class WLogEvent : public QEvent
{
public:
/**
* constructor
*
* \param entry WLogEvent which is associated with the event
**/
explicit WLogEvent( const WLogEntry& entry );
/**
*
* destructor
**/
~WLogEvent();
/**
* To access the WLogEntry of associated with the event.
*
* \return the log entry
**/
const WLogEntry& getEntry() const;
protected:
private:
/**
* The associated WLogEntry
* The associated WLogEntry to the event.
**/
const WLogEntry m_entry;
};
......
......@@ -29,7 +29,8 @@
#include <QtGui/QPainter>
/**
* Circle with different colors
* Circle with different colors, used to indicate how severe the log events are.
* Used by WQtStatusBar.
**/
class WQtStatusIcon : public QWidget
{
......@@ -39,7 +40,7 @@ class WQtStatusIcon : public QWidget
/**
* constructor
*
* \param color the color of the icon
* \param color the current color of the icon
* \param parent the parent widget
**/
WQtStatusIcon( QColor color, QWidget *parent = 0 ) :
......@@ -57,7 +58,7 @@ class WQtStatusIcon : public QWidget
}
/**
* to change the color
* Changes the current color of this item.
*
* \param color the new color
**/
......@@ -68,7 +69,7 @@ class WQtStatusIcon : public QWidget
}
/**
* returns the color
* returns the current color of the item
**/
QColor getColor() const
{
......@@ -77,7 +78,7 @@ class WQtStatusIcon : public QWidget
protected:
/**
* paints the circle with the color
* Paints the circle with the current color.
**/
virtual void paintEvent( QPaintEvent* )
{
......@@ -98,7 +99,7 @@ class WQtStatusIcon : public QWidget
private:
/**
* Color of the object
* The current color of the object.
**/
QColor m_color;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment