Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77762

Provide means to directly iterate over QProcessEnvironment entries

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
      None
    • Platform/s:
      All

      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());
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              jbornema Joerg Bornemann
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes