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

Wrong singleton declaration with qt6_target_qml_files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.0.0 Alpha
    • Build System: CMake
    • None
    • All
    • 0d31cb11ee1db0c2bf4e1324b966ce3ac29e24e4 (qt/qtdeclarative/dev)

    Description

      When settings a source as singleton:

      set_source_files_properties(
          MyType.qml
      
          PROPERTIES
              QT_QML_SINGLETON_TYPE True
      )
      qt6_add_qml_module(... MyType.qml ...)
      

      The qmldir is illformed:

      module MyModule
      optional plugin my_plugin
      classname MyClassname
      typeinfo plugins.qmltypes
      [singleton] MyType 1.0 MyType.qml
      

      It should be instead:

      module MyModule
      optional plugin my_plugin
      classname MyClassname
      typeinfo plugins.qmltypes
      singleton MyType 1.0 MyType.qml
      

      I think the confusion comes from the documentation:
      https://doc-snapshots.qt.io/qt6-dev/qtqml-modules-qmldir.html

      Which is unclear.

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            jirauser37625 user-3288b (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes