Details
-
Technical task
-
Resolution: Unresolved
-
P2: Important
-
None
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
Issue Links
- duplicates
-
QTBUG-111624 qmlsc: Support JS Date
- Open