• 21738阅读
  • 7回复

QT中静态函数无法直接用emit发出信号,那请问有什么方法可以发一个信号呢? [复制链接]

上一主题 下一主题
离线kinzess
 

只看楼主 正序阅读 楼主  发表于: 2010-02-16
rt...那个static函数,无法改造成普通函数,需要在里面发出一个信号,
但是如果这样,emit又无法使用,那要如何发出一个信号呢?
离线wells

只看该作者 7楼 发表于: 2016-02-20
楼主,您好,这种方法在qt4.8.2里 貌似行不通额?
离线meiyimin

只看该作者 6楼 发表于: 2012-10-10
引用第5楼kinzess于2010-02-19 08:07发表的  :
ls2位的方法貌似都不错~~
谢谢了`~我试试~~

弄出来没的,我也遇到了这个问题;你是怎么处理的?
离线kinzess

只看该作者 5楼 发表于: 2010-02-19
ls2位的方法貌似都不错~~
谢谢了`~我试试~~
离线steinlee

只看该作者 4楼 发表于: 2010-02-18
Use this static function to change a static variable. emit your signal just after this static func call according to the change of this static variable.

引用第2楼kinzess于2010-02-17 12:50发表的  :
那静态函数我就是没办法更改,所以才如此头痛......
Looking for remote C/C++ and Qt 兼职
离线yj_yulin

只看该作者 3楼 发表于: 2010-02-17
postevent然后在事件处理里面emit
离线kinzess

只看该作者 2楼 发表于: 2010-02-17
引用第1楼steinlee于2010-02-17 01:14发表的  :
inside a static function you can call only static functions. Emitting a signal is not a static function call.
Therefore, it will not work. You need to work around this. You can change this func to be nonstatic.


那静态函数我就是没办法更改,所以才如此头痛......
离线steinlee

只看该作者 1楼 发表于: 2010-02-17
inside a static function you can call only static functions. Emitting a signal is not a static function call.
Therefore, it will not work. You need to work around this. You can change this func to be nonstatic.
Looking for remote C/C++ and Qt 兼职
快速回复
限100 字节
 
上一个 下一个