more use of QRegExp instead of QRegularExpression for QT version < 5.15

This commit is contained in:
Axel Kohlmeyer
2023-09-17 19:52:00 -04:00
parent 20be9e64cf
commit 7f4de6b8b9

View File

@ -389,7 +389,11 @@ COMPLETER_INIT_FUNC(units, Units)
void CodeEditor::setGroupList()
{
QStringList groups;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QRegExp groupcmd(QStringLiteral("^\\s*group\\s+(\\S+)(\\s+|$)"));
#else
QRegularExpression groupcmd(QStringLiteral("^\\s*group\\s+(\\S+)(\\s+|$)"));
#endif
auto saved = textCursor();
// reposition cursor to beginning of text and search for group commands
auto cursor = textCursor();
@ -419,7 +423,11 @@ void CodeEditor::setVarNameList()
vars << QString("v_%1").arg(buffer);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QRegExp varcmd(QStringLiteral("^\\s*variable\\s+(\\S+)(\\s+|$)"));
#else
QRegularExpression varcmd(QStringLiteral("^\\s*variable\\s+(\\S+)(\\s+|$)"));
#endif
auto saved = textCursor();
// reposition cursor to beginning of text and search for group commands
auto cursor = textCursor();
@ -445,7 +453,11 @@ void CodeEditor::setVarNameList()
void CodeEditor::setComputeIDList()
{
QStringList compid;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QRegExp compcmd(QStringLiteral("^\\s*compute\\s+(\\S+)\\s+"));
#else
QRegularExpression compcmd(QStringLiteral("^\\s*compute\\s+(\\S+)\\s+"));
#endif
auto saved = textCursor();
// reposition cursor to beginning of text and search for group commands
auto cursor = textCursor();
@ -469,7 +481,11 @@ void CodeEditor::setComputeIDList()
void CodeEditor::setFixIDList()
{
QStringList fixid;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QRegExp fixcmd(QStringLiteral("^\\s*fix\\s+(\\S+)\\s+"));
#else
QRegularExpression fixcmd(QStringLiteral("^\\s*fix\\s+(\\S+)\\s+"));
#endif
auto saved = textCursor();
// reposition cursor to beginning of text and search for group commands
auto cursor = textCursor();