Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
None
-
Qt for MCUs 2.5
-
None
Description
The documentation link : https://doc.qt.io/QtForMCUs-2.5/qul-signal.html
In the documentation above, there's a section says:
So I tried it with Qt for MCUs 2.5 Desktop and it didn't work. The project is attached. (SignalTest.zip)
I have MyObj.h which is inside of CustomModule, like so.
#ifndef MYOBJ_H #define MYOBJ_H #include <qul/signal.h> #include <qul/object.h> class MyObj : public Qul::Object { public: Qul::Signal<void()> onBar; }; #endif // MYOBJ_H
And I'm using this in SignalTest.qml, like so:
import QtQuick import CustomModule Rectangle { Text { anchors.centerIn: parent text: "Qt for MCUs" } MyObj { id: myobj onBar: console.log("bar") } Component.onCompleted: {myobj.bar()} }
As far as I can see, this is exactly doing what's stated in the documentation : If signal member is called exactly as the QML signal handler it will be treated as signal named without on prefix and starting with lower case letter.
However, this results in a build error.
C:/Users/81808/Downloads/SignalTest/SignalTest.qml:15: error: Type myobj_MyObj does not have a property bar for calling
myobj.bar()