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

QString multi-arg wrong behaviors: percent(%) eats all numbers

    XMLWordPrintable

Details

    • Windows
    • f0f2a9ef2 (dev), 5be8cf4e9 (6.7)

    Description

      This is the test code:

          qInfo() << QString("%0456%01%02%03").arg("a").arg("b").arg("c").arg("d");
          qInfo() << QString("%0456%01%02%03").arg("a", "b", "c", "d");
          qInfo() << QString("%04567%01%02%03").arg("a", "b", "c", "d");
      

      This is the test result:

      "d56abc"
      "dabc"
      QString::arg: 1 argument(s) missing in %04567%01%02%03
      "%04567abc"
      

      "d56abc" <- this is correct!
      "dabc" <- in muti-arg mode, % eats 2 more numbers (56).
      QString::arg: 1 argument(s) missing in %04567%01%02%03
      "%04567abc" <- throw an error, when numbers longer than 4.

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            fragrans LL L
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes