Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.13.0
-
None
Description
QProcessEnvironment should provide a way to directly iterate over its entries.
The current way to iterate over all entries of QProcessEnvironment looks like this:
QProcessEnvironment env = QProcess::systemEnvironment(); const QStringList keys = env.keys(); for (const QString &key : keys) doSomething(key, env.value(key));
This is needlessly complicated and inefficient.
QProcessEnvironment should have begin() and end() which would allow us to write the code like this:
const QProcessEnvironment env = QProcess::systemEnvironment(); for (const auto &entry : env) doSomething(entry.key(), entry.value());