Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-30325

Qt Quick project templates use deprecated _qs

    XMLWordPrintable

Details

    • 1bd3c7d9e (13.0)

    Description

      When building a new Qt Quick project with latest (as of today) dev:

      /home/mitch/dev/temp/quick/main.cpp: In function ‘int main(int, char**)’:
      /home/mitch/dev/temp/quick/main.cpp:9:20: warning: ‘QString QtLiterals::operator""_qs(const char16_t*, size_t)’ is deprecated: Use _s from Qt::StringLiterals namespace instead. [-Wdeprecated-declarations]
          9 |     const QUrl url(u"qrc:/quick/Main.qml"_qs);
            |                    ^~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from /home/mitch/dev/qt-dev-debug/qtbase/include/QtCore/qstring.h:1,
                       from /home/mitch/dev/qt-dev/qtbase/src/corelib/kernel/qcoreapplication.h:8,
                       from /home/mitch/dev/qt-dev-debug/qtbase/include/QtCore/qcoreapplication.h:1,
                       from /home/mitch/dev/qt-dev/qtbase/src/gui/kernel/qguiapplication.h:8,
                       from /home/mitch/dev/qt-dev-debug/qtbase/include/QtGui/qguiapplication.h:1,
                       from /home/mitch/dev/qt-dev-debug/qtbase/include/QtGui/QGuiApplication:1,
                       from /home/mitch/dev/temp/quick/main.cpp:1:
      /home/mitch/dev/qt-dev/qtbase/src/corelib/text/qstring.h:1589:16: note: declared here
       1589 | inline QString operator""_qs(const char16_t *str, size_t size) noexcept
            |                ^~~~~~~~
      

      https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp?id=e2756fde8b3fb1eb6d9750b24d7cbd4154f9d4d1#n14

      There are a few other instances too:

      mitch@mitch-kubuntu:~/dev/qt-creator$ git grep _qs -- share/qtcreator/templates/wizards
      share/qtcreator/templates/wizards/projects/qtquick2-extension/example/example.cpp:    const QUrl url(u"qrc:/ExampleProjectApp/example/example.qml"_qs);
      share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp:    const QUrl url(u"qrc:/%{JS: value('ProjectName')}/Main.qml"_qs);
      share/qtcreator/templates/wizards/projects/qtquickapplication_compat/main.cpp:    const QUrl url(u"qrc:/%{JS: value('ProjectName')}/main.qml"_qs);
      

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes