How do I go about recalling a method from an event

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

Moderator: andrew

Post Reply
pietro_72_
Full Member
Posts: 54
Joined: Fri Apr 17, 2015 6:40 am
Location: http://creativitainformaticart.altervista.org

How do I go about recalling a method from an event

Post by pietro_72_ » Mon Nov 04, 2019 10:13 am

Hello
Sorry, I confess I have some difficulty with object-oriented programming

If instead of using the function:
     operativeModePres = function () {
         ......
I use the method:
     OrthogonalProjections.prototype.operativeModePres = function () {

As I have to do to recall this method from an event I tried a few ways but it does not go:
     // operativeMode ['currentIndexChanged (int)']. connect (function () {operativeModePres ();});
     // operativeMode ['currentIndexChanged (int)']. connect (function () {this.operativeModePres;});
     operativeMode ['currentIndexChanged (int)']. connect (function () {operativeModePres.call (operativeModePres);});

pietro_72_
Full Member
Posts: 54
Joined: Fri Apr 17, 2015 6:40 am
Location: http://creativitainformaticart.altervista.org

Re: How do I go about recalling a method from an event

Post by pietro_72_ » Mon Nov 04, 2019 9:31 pm

Searching for solutions on https://github.com/qcad/qcad/ have managed to solve this problem as follows:

operativeMode ['currentIndexChanged (int)']. connect (this, "operativeModePres");

From here maybe I can solve the previous problem:
"Loss of script operation after using snaps"

Post Reply

Return to “QCAD Developers and Contributors”