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

Provide means to directly iterate over QProcessEnvironment entries

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.13.0
    • Core: I/O
    • None
    • 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

            thiago Thiago Macieira
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes