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

QML on Windows: Unable to assign ClassA to ClassA

    XMLWordPrintable

Details

    • Windows
    • 0a567a7f9 (dev), 4a79ed90f (6.9), 0370138e2 (6.8)

    Description

      We have two QML_ELEMENT classes, ClassA and ClassB in two different libraries/plugins, both in the same namespace.

      ClassB has a Q_PROPERTY of type ClassA*. ClassA is forward declared in ClassB.h using Q_DECLARE_OPAQUE_POINTER.

      Then ClassA and ClassB are instantiated in QML. Here the ClassB property is initialized with the ClassA instance.

      When started on Windows then we get the error:

      "qrc:/qt/qml/AssignmentIssue/Main.qml:18:5: Unable to assign elements::foo::bar::ClassA to elements::foo::bar::ClassA"

      and the ClassB instance is not initialized correctly.

       

      If we compile and run this code on Linux then there is no error message and both instances are initialized correctly.

       

      See attached code example.

      I don't know if it is really necessary to have two different plugins in order to reproduce this issue. This way it is close to our real world application.

      Attachments

        For Gerrit Dashboard: QTBUG-134883
        # Subject Branch Project Status CR V

        Activity

          People

            qtqmlteam Qt Qml Team User
            cyril Harald Prasser
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change