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

QStringView breaks format-string logging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.0, 6.6
    • None
    • All

    Description

      `qUtf8Printable()` and `qUtf16Printable()` do not work QStringView for the reasons outline here:

      https://codereview.qt-project.org/c/qt/qtbase/+/396573/comments/4a3686c7_4a1d521e

      With many string related functions returning QStringView instead of a QString this breaks format-string based logging at many unexpected places. This is very annoying as it breaks Qt's major selling point of providing consistent and predictable API.

      In my oppinion either the decision made in QTBUG-100979 should be reverted and qUtf*Printable() should be made working with QStringView. The other option is to consider deprecation of format-string based logging API as it's not possible to make it work consistent and predictable with QStringView.

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            hasselmm Mathias Hasselmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes