Sending signal from static class method in Qt

后端 未结 4 570
有刺的猬
有刺的猬 2020-12-29 09:08

I am trying to code a static callback function that is called frequently from another static function within the same class. My callback function needs to emit

4条回答
  •  执念已碎
    2020-12-29 09:21

    in case someone still finding the solution, here is what I did, it works in my project. 1. make your class to be a singleton 2. in static cb function , load emitFunction from the your singleton class

        static int callback(int val)
       {
       /* Called multiple times (100+) */
       MYClass::getInstance()->emitFunction(val);
       }
    

提交回复
热议问题