compatibility with Qt 5.12 on Ubuntu 20.04LTS
This commit is contained in:
@ -115,16 +115,20 @@ void LogWindow::stop_run()
|
|||||||
void LogWindow::next_warning()
|
void LogWindow::next_warning()
|
||||||
{
|
{
|
||||||
auto *doc = document();
|
auto *doc = document();
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
auto regex = QRegExp(QStringLiteral("^(ERROR|WARNING).*$"));
|
||||||
|
#else
|
||||||
auto regex = QRegularExpression(QStringLiteral("^(ERROR|WARNING).*$"));
|
auto regex = QRegularExpression(QStringLiteral("^(ERROR|WARNING).*$"));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (warnings->get_nwarnings() > 0) {
|
if (warnings->get_nwarnings() > 0) {
|
||||||
// wrap around search
|
// wrap around search
|
||||||
if (!this->find(regex)) {
|
if (!find(regex)) {
|
||||||
this->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||||
this->find(regex);
|
find(regex);
|
||||||
}
|
}
|
||||||
// move cursor to unselect
|
// move cursor to unselect
|
||||||
this->moveCursor(QTextCursor::NextBlock, QTextCursor::MoveAnchor);
|
moveCursor(QTextCursor::NextBlock, QTextCursor::MoveAnchor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user