Details

    Description

      When retrieving a QTime object in QML from C++ like

      Q_INVOKABLE QTime bar() const { return QTime::currentTime(); }
      

      and then calling a method on the returned object in QML like

      console.log(Foo.bar().getTime())
      

      then the qml compiler issues a warning, that it cannot find the method on the object:

      Warning: Main.qml:12:56: Member "getTime" not found on type "QTime" [missing-property]
          Component.onCompleted: () => console.log(Foo.bar().getTime())
                                                             ^^^^^^^
      Warning: Main.qml:12:56: Could not compile binding for onCompleted: Type QTime of QTime does not have a property getTime for calling [compiler]
          Component.onCompleted: () => console.log(Foo.bar().getTime())
                                                             ^^^^^^^
      

      I assume the QTime object is converted into a Javascript Date object, but the compiler does not have this implemented?

      Attachments

        1. sandbox.tgz
          1 kB
          Markus Bader

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              moerkb Markus Bader
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes