Rem Rem - 14 days ago 4
C++ Question

Connect to C++ signal from QML

I want to connect to C++ signals from QML like this:

action.onMouseUp = function() {
console.log("mouse up>>");

And declare in my C++ object this signal:

void mouseUp(const QPointF point);

But I'm getting QML Error: TypeError: Cannot assign to read-only property "mouseUp". What might the problem be?


You need to call connect method of action.onMouseUp object.

action.onMouseUp.connect( function() {
    console.log("mouse up>>");