Add ability to filter log messages by type.

This commit is contained in:
sledgehammer999
2016-01-24 21:38:45 +02:00
parent b0c324ace8
commit 73832a5ed8
10 changed files with 194 additions and 46 deletions

View File

@@ -31,6 +31,7 @@
#define LOGLISTWIDGET_H
#include <QListWidget>
#include "base/logger.h"
QT_BEGIN_NAMESPACE
class QKeyEvent;
@@ -41,10 +42,12 @@ class LogListWidget: public QListWidget
Q_OBJECT
public:
explicit LogListWidget(int max_lines = 100, QWidget *parent = 0);
// -1 is the portable way to have all the bits set
explicit LogListWidget(int maxLines, const Log::MsgTypes &types = Log::ALL, QWidget *parent = 0);
void showMsgTypes(const Log::MsgTypes &types);
public slots:
void appendLine(const QString &line);
void appendLine(const QString &line, const Log::MsgType &type);
protected slots:
void copySelection();
@@ -54,7 +57,7 @@ protected:
private:
int m_maxLines;
Log::MsgTypes m_types;
};
#endif // LOGLISTWIDGET_H