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

QML metatype: A* is not "compatible" with const A*

    XMLWordPrintable

Details

    Description

      I have some QObject-derived class Foo.

      I register it using: qmlRegisterType<Foo>();

      I have 2 classes exported to QML: one has this method:

      Q_INVOKABLE Foo* createFoo();

      Second one has this method:

      Q_INVOKABLE void useFoo(const Foo*)

      The code in QML:

      var foo = firstClass.createFoo();

      secondClass.useFoo(foo);

      The last line of code generates exception that the parameter is unknown.

      WORKAROUND: I had to remove const specifier from the useFoo parameter.

       

      Attachments

        Issue Links

          Activity

            People

              shausman Simon Hausmann
              alervd Alexander Dyagilev
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: