compatibility with Qt 5.12 on Ubuntu 20.04LTS

This commit is contained in:
Axel Kohlmeyer
2024-12-28 22:08:52 -05:00
parent d70b923c5a
commit 7d67bcad22

View File

@ -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);
} }
} }