RActionAdapter::escapeEvent not called on right mouse button

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
mink
Active Member
Posts: 30
Joined: Mon Jan 19, 2015 7:20 pm

RActionAdapter::escapeEvent not called on right mouse button

Post by mink » Tue Apr 14, 2015 12:53 pm

Hi,

documentation of RActionAdapter states:

virtual void escapeEvent ()
Escape events are triggered if the user clicks the right mouse button or hits the Escape key.

implementing escapeEvent in an action works fine - it is called when user hits escape key.
However, my function is not called when user clicks the right mouse button....

observed in 3.8.1 win and linux
also in 3.9.1 win (linux version still comiling QCad sources ...)

Any hints?

Thanks and regards,

Ulrich

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: RActionAdapter::escapeEvent not called on right mouse bu

Post by andrew » Tue Apr 14, 2015 3:26 pm

This functionality is actually implemented in EAction:
EAction.prototype.mouseReleaseEvent = function(event) {
    if (event.button() === Qt.RightButton) {
        this.escapeEvent();
    }
};
If your action is implemented in ECMAScript and derived from EAction, escapeEvent should be triggered, otherwise you can provide your own similar implementation of mouseReleaseEvent.

mink
Active Member
Posts: 30
Joined: Mon Jan 19, 2015 7:20 pm

Re: RActionAdapter::escapeEvent not called on right mouse bu

Post by mink » Wed Apr 15, 2015 6:40 am

Hi Andrew,

thanks a lot ! Implementing myAction::mouseReleaseEvent did the trick.
Regards,
Ulrich

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”