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

Registering a 2.0 QML type before a 1.0 version breaks import of 2.0

XMLWordPrintable

      Registering the 2.0 version of a type before 1.0 causes "import ModuleName 2.0" to pick up the 1.0 version:

      qmlRegisterType<BuggyVersion2>(uri,2,0,"Buggy");
      qmlRegisterType<BuggyVersion1>(uri,1,0,"Buggy");
      
      import Qt 4.7
      import BuggyModule 2.0
      Buggy {}
      

      Reversing the order of the registrations fixes the problem. See attached example.

        1. buggymodule.tar.gz
          0.9 kB
          Rhys Weatherley (closed Nokia identity)
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            aakenned Aaron Kennedy
            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes