首页| 论坛| 消息

标题:QT中静态函数无法直接用emit发出信号,那请问有什么方法可以发一个信号呢?
作者:kinzess
日期:2010-02-16 00:01
内容:

rt...那个static函数,无法改造成普通函数,需要在里面发出一个信号,
但是如果这样,emit又无法使用,那要如何发出一个信号呢?


#1 [steinlee 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.
#2 [kinzess 02-17 12:50]
引用第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.
那静态函数我就是没办法更改,所以才如此头痛......
#3 [yj_yulin 02-17 19:29]
postevent然后在事件处理里面emit
#4 [steinlee 02-18 00:56]
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发表的:

那静态函数我就是没办法更改,所以才如此头痛......
#5 [kinzess 02-19 08:07]
ls2位的方法貌似都不错~~
谢谢了`~我试试~~

<< 1 2 >> (1/2)

回复 发表
主题 版块