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

Windows: Document change of behavior for QCoreApplication::arguments()

XMLWordPrintable

      The handling of arguments masked with ' (ASCII char 0x27) has changed in 5.1 on Windows. QCoreApplication will report the original PATH, while Qt 5.1 stripped the ':

      #include <QCoreApplication>
      #include <QDebug>
      #include <QStringList>
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          qDebug() << "QCoreApplicaton::arguments().last(): " << qPrintable(a.arguments().last());
      }
      

      run with 5.1:

      test.exe 'hello'
      QCoreApplicaton::arguments().last():  hello
      

      with 5.2:

      test.exe 'hello'
      QCoreApplicaton::arguments().last():  'hello'
      

      Since this might possibly affect a lot of applications, it should at least be documented. The change of behavior is most likely caused by https://codereview.qt-project.org/#change,64127 .

        For Gerrit Dashboard: QTBUG-34744
        # Subject Branch Project Status CR V

            dfaure David Faure (Private)
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes