Rem Rem - 1 year ago 196
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?

Answer Source

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

action.onMouseUp.connect( function() {
    console.log("mouse up>>");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download