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

Singleton error in lower plugin version

    XMLWordPrintable

    Details

    • Platform/s:
      macOS
    • Commits:
      d94dd247ecd6753150dc2a7ef6be4ccb482e9423

      Description

      I added singleton qml type into higher plugin version and lower version stopped working.

      I would like to use version 0.9, but I cannot, because it cannot find MySettings component, which is defined only for version 1.0. - but I dont want to use this new component, all I want is old component of version 0.9.

      Here is a quick example:

      main.qml
      ./imports/MyPlugin/MyComponent_0_9.qml
      ./imports/MyPlugin/MyComponent_1_0.qml
      ./imports/MyPlugin/MySettings_1_0.qml
      ./imports/MyPlugin/qmldir

       

      //file: main.qml
      import QtQuick 2.12
      import MyPlugin 0.9
      
      //this works fine
      //import MyPlugin 1.0
      
      Item {    
          width: 100    
          height: 100    
          MyComponent {        
              anchors.centerIn: parent    
          }
      }

       

      //file: qmldir
      module MyPlugin
      MyComponent 0.9 MyComponent_0_9.qml
      MyComponent 1.0 MyComponent_1_0.qml
      singleton MySettings 1.0 MySettings_1_0.qml
      

       

      //file MySettings_1_0.qml
      pragma Singleton
      import QtQuick 2.0
      
      Item {    
          property int baseWidth: 50
      }
      

      MyComponent are just simple rectangles.

       

      When I run it by:

      qmlscene main.qml -I ./imports
      

      I see error:  

      main.qml:-1 MySettings is not a type

       

      Looks like problem is that components of different major versions are declared in the same qmldir file.

      singletonpluginbug.zip

       

        Attachments

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

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            keresan Martin Mich
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes