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

Documentation of the QML singleton: correct the snippet for pragma Singleton

    XMLWordPrintable

Details

    • Windows

    Description

      Thanks for creating https://doc.qt.io/qt-6/qml-singleton.html this was really something missing .

      I noticed though that the https://doc.qt.io/qt-6/qml-singleton.html#defining-singletons-in-qml says that we need to write

      pragma singleton

      I think it should be:

      pragma Singleton

      Not writing singleton with a capital S leads to a compile error error:
      Error compiling qml file: C:/work/Qt/SingletonForFonts/Globals.qml:1:1: error: Unknown pragma 'singleton'

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            pijaouen Pierre Jaouen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes