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

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

XMLWordPrintable

    • Windows
    • f4fc10172 (dev), 5911f307e (6.7)
    • DaVinci 97

      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'

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

            andreas.eliasson Andreas Eliasson
            pijaouen Pierre Jaouen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes