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

Register singleton instance clears all elements in that namespace version

    XMLWordPrintable

Details

    Description

      In https://doc.qt.io/qt-5/qqmlengine.html#QML_SINGLETON

      This behavior can be overridden by calling qmlRegisterSingletonType() with a specific factory function or qmlRegisterSingletonInstance() with a specific instance for the same class and the same type namespace and version.

      But calling qmlRegisterSingletonInstance causes all other QML_ELEMENT to not be available. I've attached an example application to demonstrate the issue. The example works if main.cpp:16 is commented.

       

      Attachments

        1. main.cpp
          0.8 kB
        2. singleton.h
          0.3 kB
        3. singleton-bug.pro
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jbarbosa João Barbosa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes