logview improvments and fixes
This commit is contained in:
@@ -23,11 +23,12 @@
|
||||
#include <QWidget>
|
||||
#include <QIcon>
|
||||
#include <QImage>
|
||||
#include <QDebug>
|
||||
#include <QTextBlockFormat>
|
||||
#include <QRegularExpression>
|
||||
#include "qad_export.h"
|
||||
|
||||
class QTextEdit;
|
||||
class QAction;
|
||||
|
||||
namespace Ui {
|
||||
class LogView;
|
||||
@@ -56,6 +57,12 @@ public:
|
||||
QColor color = QColor(),
|
||||
bool bold = false);
|
||||
|
||||
void registerCategory(const QString & label,
|
||||
QRegularExpression regexp = QRegularExpression(),
|
||||
const QImage & icon = QImage(),
|
||||
QColor color = QColor(),
|
||||
bool bold = false);
|
||||
|
||||
void addText(const QString & text, bool insert_newline = true);
|
||||
|
||||
private:
|
||||
@@ -63,11 +70,12 @@ private:
|
||||
Category();
|
||||
void makeIcon(QSize size, QSize size_icon);
|
||||
QString label;
|
||||
QString keyword;
|
||||
QRegularExpression regexp;
|
||||
QImage image, icon_image;
|
||||
QIcon icon;
|
||||
QColor color;
|
||||
bool bold;
|
||||
inline bool operator ==(const Category & it) const {return (regexp.pattern() == it.regexp.pattern());}
|
||||
};
|
||||
|
||||
void changeEvent(QEvent * e);
|
||||
@@ -75,8 +83,9 @@ private:
|
||||
QSize iconImageSize();
|
||||
|
||||
Ui::LogView * ui;
|
||||
QMap<QString, Category> categories; // by keyword
|
||||
QList<Category> categories;
|
||||
QTextCharFormat def_cf;
|
||||
QAction * actionLogSelectAll, * actionLogCopy, * actionLogClear;
|
||||
|
||||
public slots:
|
||||
void setFilterVisible(bool yes);
|
||||
|
||||
Reference in New Issue
Block a user