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

Behavior breakage in Qt 6.5: Q_INVOKABLE functions with a enum reference parameter

XMLWordPrintable

    • All

      Prior to Qt 6.5, you could declare a Q_INVOKABLE function like this:

      class MyClass : public QObject
      {
          Q_OBJECT
      public:
          using QObject::QObject;
          enum class MyEnum {
              Value
          };
          Q_ENUM(MyEnum);
      
          Q_INVOKABLE void doSomething(MyEnum &enum);
      }
      

      And now the function could be called from QML:

      myObject.doSomething(MyClass.Value)
      

      As of Qt 6.5 this invoke fails: `Error: Unknown method parameter type: MyEnum&`

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

            qtqmlteam Qt Qml Team User
            andrhans Andreas Aardal Hanssen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes