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

'const' keyword in method parameter

    XMLWordPrintable

Details

    Description

      I have my own class Class1, I register this class: qmlRegisterType<Class1>("my_uri", 1, 0, "Class1");
      Than I want to call next method from QML:
      Q_INVOKABLE void method1(const Class1 *param) const;
      In runtime I have error:
      file:///.../QmlFile1.qml:...: Error: Unknown method parameter type: const Class1*

      But this method (without 'const' keyword) is working fine:
      Q_INVOKABLE void method1(Class1 *param) const;

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            ildar Gilmanov Ildar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes