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

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

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.0
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      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

            • Assignee:
              docteam Qt Documentation Team
              Reporter:
              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