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

Directory Listing qmldir Files docs miss to document optional "singleton" for Object Type Declaration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.0
    • Documentation
    • None

    Description

      The documentation for contents of a "directory listing" qmldir file (https://doc.qt.io/qt-5/qtqml-syntax-directoryimports.html#directory-listing-qmldir-files) defines as syntax for Object Type Declaration only:
      <TypeName> <FileName>

      Expected would be:
      [singleton] <TypeName> <FileName>

      So far users have to have and to transfer their knowledge about the "module definition" qmldir file that the important aspect to note a "singleton" aspect of a class already in the qmldir manifest is needed, and guess it works the same way by prepending it on the line.
      Otherwise they are left wondering why their code does not work when using singletons.

      So it would be needed to have the proper way to annotate a singleton documented also here, to avoid fails and the need for (potentially future-unsafe) guess work.

      Compare
      https://doc.qt.io/qt-5/qtqml-modules-qmldir.html#contents-of-a-module-definition-qmldir-file

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            kossebau Friedrich W. H. Kossebau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes