-
UID:124483
-
- 注册时间2011-11-16
- 最后登录2013-01-21
- 在线时间14小时
-
- 发帖6
- 搜Ta的帖子
- 精华0
- 金钱70
- 威望16
- 贡献值0
- 好评度6
-
访问TA的空间加好友用道具
|
- void Thread::run()
- {
- ping=new QProcess;
- ping->start("regedit");
- output=tr("");
- connect(ping,SIGNAL(readyRead()),this,SLOT(readoutput()));//信号槽失败,不能到readoutput函数
- QString q0="信号槽结束";
- qDebug()<<q0;
- }
- void Thread::readoutput()
- {
- // output+=ping->readAll();
- // qDebug()<<output;
- QString q0="进入Threadrun函数";
- qDebug()<<q0;
- }
信号槽的槽函数不执行请问这个是什么原因。打包的http://www.everbox.com/f/8AYgJsUs7kg2sLDj1OmuqidK7S 已经解决已经解决原因在于在thread中用了qprocess的话引起父子线程问题,蛋碎ping->moveToThread(this);run(){ 最后加上 exec(); }
|