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

timeArgs are not cleared in QMessagePattern::setPattern

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.7.1
    • 5.7.0
    • Core: Other
    • None

    Description

      Subsequent calls to qSetMessagePattern with different %{time ...} values will not change the time format in the debug output.
      This happens because the timeArgs list is not cleared alongside literals and tokens in QMessagePattern::setPattern.

      For example:

      void foo() {
      qSetMessagePattern("%{time yyyy} %{message}");
      qDebug() << "NARF";
      qSetMessagePattern("%{time yy} %{message}");
      qDebug() << "ZORT";
      }

      Will produce:

      2016 NARF
      2016 ZORT

      Instead of:

      2016 NARF
      16 ZORT

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            paranoid René Küppers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes