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

As a user of QStringBuilder, I'd like to use the framework for other strings, not just QString and QByteArray

    XMLWordPrintable

    Details

    • Type: User Story
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      We use a lot of Qt in our projects, but ever since QStringView was introduced, we have slowly changed some of our code to use std::u16string, esp. where very short strings are common (when will QString get SSO? ), or where we can make good use of the pmr version. One thing we find is that when we do the change, apart from the usual Qt-API-to-STL-API ports (you know, isEmpty() -> empty(), qsizetype -> size_t, etc), we run into the problem that while QStringBuilder accepts u16string (if we wrap it in QStringView) on the RHS, it doesn't work on the LHS of an expression, even though the used API subset (reserve(), size(), capacity(), data(), resize()) is available on std::u16string, too.

      It would be nice if the feature could be used to produce std::u16string (incl. pmr versions, please) and, say, QVarLengthArray<char16_t>, too. Icing on the cake would be if it would work with every container that has a compatible value_type and provides the requires API subset.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              cnn Qt Core & Network
              Reporter:
              mmutz Marc Mutz
              PM Owner:
              Vladimir Minenko Vladimir Minenko
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes