summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonproject.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-06-23 13:00:43 +0200
committerhjk <hjk@qt.io>2020-06-25 07:13:43 +0000
commit03838decb9c104b8b8327ac90510472c830e0e91 (patch)
tree12ea1855506c7dafde8dc5c6e83e23c772f593c7 /src/plugins/python/pythonproject.cpp
parent5a091c3d98d55ffa1aa19320a1b659b858f07cbd (diff)
downloadqt-creator-03838decb9c104b8b8327ac90510472c830e0e91.tar.gz
More QRegularExpression and include for Qt 6
Task-number: QTCREATORBUG-24098 Change-Id: Ia537e26efd3f37319c38d906e569b255768371f9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/python/pythonproject.cpp')
-rw-r--r--src/plugins/python/pythonproject.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp
index 3c3b225de9..3b53292d8c 100644
--- a/src/plugins/python/pythonproject.cpp
+++ b/src/plugins/python/pythonproject.cpp
@@ -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);
}
}