mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
code standard fixes
This commit is contained in:
parent
a974282bdf
commit
e7a16d4294
1 changed files with 13 additions and 12 deletions
|
@ -29,6 +29,7 @@ const int SEARCH_BUTTON_WIDTH = 20;
|
||||||
const int SEARCH_TOGGLE_BUTTON_WIDTH = 50;
|
const int SEARCH_TOGGLE_BUTTON_WIDTH = 50;
|
||||||
const int SEARCH_TEXT_WIDTH = 240;
|
const int SEARCH_TEXT_WIDTH = 240;
|
||||||
const int TIME_STAMP_LENGTH = 16;
|
const int TIME_STAMP_LENGTH = 16;
|
||||||
|
const int FONT_WEIGHT = 75;
|
||||||
const QColor HIGHLIGHT_COLOR = QColor("#3366CC");
|
const QColor HIGHLIGHT_COLOR = QColor("#3366CC");
|
||||||
const QColor BOLD_COLOR = QColor("#445c8c");
|
const QColor BOLD_COLOR = QColor("#445c8c");
|
||||||
const QString BOLD_PATTERN = "\\[\\d*\\/.*:\\d*:\\d*\\]";
|
const QString BOLD_PATTERN = "\\[\\d*\\/.*:\\d*:\\d*\\]";
|
||||||
|
@ -195,10 +196,10 @@ void BaseLogDialog::updateSelection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Highlighter::Highlighter(QTextDocument* parent) : QSyntaxHighlighter(parent) {
|
Highlighter::Highlighter(QTextDocument* parent) : QSyntaxHighlighter(parent) {
|
||||||
boldFormat.setFontWeight(75);
|
boldFormat.setFontWeight(FONT_WEIGHT);
|
||||||
boldFormat.setForeground(BOLD_COLOR);
|
boldFormat.setForeground(BOLD_COLOR);
|
||||||
keywordFormat.setForeground(HIGHLIGHT_COLOR);
|
keywordFormat.setForeground(HIGHLIGHT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Highlighter::highlightBlock(const QString& text) {
|
void Highlighter::highlightBlock(const QString& text) {
|
||||||
QRegExp expression(BOLD_PATTERN);
|
QRegExp expression(BOLD_PATTERN);
|
||||||
|
@ -206,9 +207,9 @@ void Highlighter::highlightBlock(const QString& text) {
|
||||||
int index = text.indexOf(expression, 0);
|
int index = text.indexOf(expression, 0);
|
||||||
|
|
||||||
while (index >= 0) {
|
while (index >= 0) {
|
||||||
int length = expression.matchedLength();
|
int length = expression.matchedLength();
|
||||||
setFormat(index, length, boldFormat);
|
setFormat(index, length, boldFormat);
|
||||||
index = text.indexOf(expression, index + length);
|
index = text.indexOf(expression, index + length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyword.isNull() || keyword.isEmpty()) {
|
if (keyword.isNull() || keyword.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue