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

weixin_38056491 2019-09-19 01:43:44
rt...那个static函数,无法改造成普通函数,需要在里面发出一个信号,但是如果这样,emit又无法使用,那要如何发出一个信号呢?
...全文
885 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38095754 2019-09-19
  • 打赏
  • 举报
回复
楼主,您好,这种方法在qt4.8.2里 貌似行不通额?
Iceblood_kaka 2019-09-19
  • 打赏
  • 举报
回复
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.
weixin_38061328 2019-09-19
  • 打赏
  • 举报
回复
引用第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.那静态函数我就是没办法更改,所以才如此头痛......
weixin_38066087 2019-09-19
  • 打赏
  • 举报
回复
postevent然后在事件处理里面emit
weixin_38068392 2019-09-19
  • 打赏
  • 举报
回复
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发表的  :那静态函数我就是没办法更改,所以才如此头痛......
weixin_38073387 2019-09-19
  • 打赏
  • 举报
回复
ls2位的方法貌似都不错~~谢谢了`~我试试~~
weixin_38088709 2019-09-19
  • 打赏
  • 举报
回复
引用第5楼kinzess于2010-02-19 08:07发表的  :ls2位的方法貌似都不错~~谢谢了`~我试试~~ 弄出来没的,我也遇到了这个问题;你是怎么处理的?

473

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧