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

QVariant is loosing meta type when passed from C++ to QML and back

    XMLWordPrintable

Details

    Description

      When you create a QVariant in C++ and fill it with a custom enum (which is properly registered with Q_ENUM), then pass that QVariant to QML, store it in QML in a property of type 'var' and then invoking a C++ method from QML and passing along that var property, the QVariant parameter of that C++ method has suddenly a metaType 'int'.

      This is a regression in Qt6, worked fine in Qt 5.15.

      A testcase that shows the scenario is attached.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              tokoe.kdab Tobias Koenig
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes