more use of QRegExp instead of QRegularExpression for QT version < 5.15
This commit is contained in:
@ -389,7 +389,11 @@ COMPLETER_INIT_FUNC(units, Units)
|
|||||||
void CodeEditor::setGroupList()
|
void CodeEditor::setGroupList()
|
||||||
{
|
{
|
||||||
QStringList groups;
|
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+|$)"));
|
QRegularExpression groupcmd(QStringLiteral("^\\s*group\\s+(\\S+)(\\s+|$)"));
|
||||||
|
#endif
|
||||||
auto saved = textCursor();
|
auto saved = textCursor();
|
||||||
// reposition cursor to beginning of text and search for group commands
|
// reposition cursor to beginning of text and search for group commands
|
||||||
auto cursor = textCursor();
|
auto cursor = textCursor();
|
||||||
@ -419,7 +423,11 @@ void CodeEditor::setVarNameList()
|
|||||||
vars << QString("v_%1").arg(buffer);
|
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+|$)"));
|
QRegularExpression varcmd(QStringLiteral("^\\s*variable\\s+(\\S+)(\\s+|$)"));
|
||||||
|
#endif
|
||||||
auto saved = textCursor();
|
auto saved = textCursor();
|
||||||
// reposition cursor to beginning of text and search for group commands
|
// reposition cursor to beginning of text and search for group commands
|
||||||
auto cursor = textCursor();
|
auto cursor = textCursor();
|
||||||
@ -445,7 +453,11 @@ void CodeEditor::setVarNameList()
|
|||||||
void CodeEditor::setComputeIDList()
|
void CodeEditor::setComputeIDList()
|
||||||
{
|
{
|
||||||
QStringList compid;
|
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+"));
|
QRegularExpression compcmd(QStringLiteral("^\\s*compute\\s+(\\S+)\\s+"));
|
||||||
|
#endif
|
||||||
auto saved = textCursor();
|
auto saved = textCursor();
|
||||||
// reposition cursor to beginning of text and search for group commands
|
// reposition cursor to beginning of text and search for group commands
|
||||||
auto cursor = textCursor();
|
auto cursor = textCursor();
|
||||||
@ -469,7 +481,11 @@ void CodeEditor::setComputeIDList()
|
|||||||
void CodeEditor::setFixIDList()
|
void CodeEditor::setFixIDList()
|
||||||
{
|
{
|
||||||
QStringList fixid;
|
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+"));
|
QRegularExpression fixcmd(QStringLiteral("^\\s*fix\\s+(\\S+)\\s+"));
|
||||||
|
#endif
|
||||||
auto saved = textCursor();
|
auto saved = textCursor();
|
||||||
// reposition cursor to beginning of text and search for group commands
|
// reposition cursor to beginning of text and search for group commands
|
||||||
auto cursor = textCursor();
|
auto cursor = textCursor();
|
||||||
|
|||||||
Reference in New Issue
Block a user