LogView changes - registerCategory() now take two QBrush: text and background. If NoBrush the no changes in colors

This commit is contained in:
2021-01-22 18:02:53 +03:00
parent 9ba018b868
commit 63aea62c89
3 changed files with 18 additions and 11 deletions

View File

@@ -60,13 +60,15 @@ public:
void registerCategory(const QString & label,
QString keyword = QString(),
const QImage & icon = QImage(),
QColor color = QColor(),
QBrush text_brush = Qt::NoBrush,
QBrush background = Qt::NoBrush,
bool bold = false);
void registerCategory(const QString & label,
QRegularExpression regexp,
const QImage & icon = QImage(),
QColor color = QColor(),
QBrush text_brush = Qt::NoBrush,
QBrush background = Qt::NoBrush,
bool bold = false);
void removeCategory(QString keyword);
void removeCategory(QRegularExpression regexp);
@@ -83,7 +85,8 @@ private:
QRegularExpression regexp;
QImage image, icon_image;
QIcon icon;
QColor color;
QBrush text_brush;
QBrush background;
bool bold;
inline bool operator ==(const Category & it) const {return (regexp.pattern() == it.regexp.pattern());}
};