use QtRegExp for QT 5.12 on Ubuntu 20.04LTS

This commit is contained in:
Axel Kohlmeyer
2023-09-17 19:38:53 -04:00
parent 3e9f1c8af2
commit cf8b157702

View File

@ -1106,7 +1106,11 @@ void LammpsGui::render_image()
// add a run 0 and thus create the state of the initial system without running.
// this will allow us to create a snapshot image.
auto saved = ui->textEdit->textCursor();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
if (ui->textEdit->find(QRegExp(QStringLiteral("^\\s*(run|minimize)\\s+")))) {
#else
if (ui->textEdit->find(QRegularExpression(QStringLiteral("^\\s*(run|minimize)\\s+")))) {
#endif
auto cursor = ui->textEdit->textCursor();
cursor.movePosition(QTextCursor::PreviousBlock);
cursor.movePosition(QTextCursor::EndOfLine);