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

Wrong singleton declaration with qt6_target_qml_files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.0.0 Alpha
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      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

            Assignee:
            jbornema Joerg Bornemann
            Reporter:
            greenwolf BenoƮt Gradit
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes