More QRegularExpression and include for Qt 6

Task-number: QTCREATORBUG-24098
Change-Id: Ia537e26efd3f37319c38d906e569b255768371f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-06-23 13:00:43 +02:00
parent 5a091c3d98
commit 03838decb9
8 changed files with 38 additions and 29 deletions

View File

@@ -377,16 +377,17 @@ void PythonBuildSystem::parse()
*/
static void expandEnvironmentVariables(const QProcessEnvironment &env, QString &string)
{
static QRegExp candidate(QLatin1String("\\$\\$\\((.+)\\)"));
const QRegularExpression candidate("\\$\\$\\((.+)\\)");
int index = candidate.indexIn(string);
QRegularExpressionMatch match;
int index = string.indexOf(candidate, 0, &match);
while (index != -1) {
const QString value = env.value(candidate.cap(1));
const QString value = env.value(match.captured(1));
string.replace(index, candidate.matchedLength(), value);
string.replace(index, match.capturedLength(), value);
index += value.length();
index = candidate.indexIn(string, index);
index = string.indexOf(candidate, index, &match);
}
}