• 3085阅读
  • 1回复

[提问]请教一个关于Qt多线程的问题? [复制链接]

上一主题 下一主题
离线x3340574
 
只看楼主 倒序阅读 楼主  发表于: 2012-12-26
    QThread *thread = new QThread;    ComputionBRG *computionBGR = new ComputionBRG;    computionBGR->moveToThread(thread);  //connect(computionBGR, SIGNAL(error(QString)), this, SLOT(errorString(QString)));    connect(thread, SIGNAL(started()), computionBGR, SLOT(process()));    connect(computionBGR, SIGNAL(finished()), thread, SLOT(quit()));    connect(computionBGR, SIGNAL(finished()), computionBGR, SLOT(deleteLater()));    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));    thread->start();我是利用moveto的方式实现多线程,但是运行程序的时候偶尔会出现错误,提示
QThread::Destroyed while thread is still running
QObject::killTimers: timers cannot be stopped from another thread
请教各位大牛了,我实在找不到原因了。。。
离线x3340574
只看该作者 1楼 发表于: 2012-12-26
是在早不到原因了
快速回复
限100 字节
 
上一个 下一个