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

QXmlStreamWriter::writeAttribute doesn't accept QStringView arguments

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.4.0 Beta4
    • None

    Description

      I was trying to feed a QStringView to QXmlStreamWriter::writeAttribute, but the compiler refused it, because QXmlStreamWriter::writeAttribute only accepts QString. Basically, every method that takes a `const QString &` could be made into a `QStringView` to broaden its use without any API or performance impact. (Potentially the ABI, though, so that might be a new method.)

      Would there be any downside of doing so? The benefits are explained in https://abseil.io/tips/1, but that's with standard C++ types and not Qt ones. (I'm not saying anything about moving all Qt to string views, just slightly widening an API!)

      Attachments

        Activity

          People

            mmutz Marc Mutz
            dourouc05_ Thibaut Cuvelier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: