QObject::killTimers: timers cannot be stopped from another thread

weixin_38055275 2019-09-19 02:37:44
我使用QThread采用的是传说中的最好的方法"一种被开发人员强烈推荐,但Qt Manual和例子中只字未提的方法",也就是新建一个类派生QObject并使用movetothread函数。void RunBundl::myrun(){    emit mysigl();//给主线程发信号    BundlerApp::RunBundler();}class MainWindow: : public QMainWindow{   。。。。private:      RunBundl *mybundl;}在MainWindow的构造函数中我这样写道:     QThread *bdthread = new QThread(this);    mybundl = new RunBundl();    mybundl->moveToThread(bdthread);    connect(densepointAct, SIGNAL(triggered()), mybundl, SLOT(myrun()));  //densepointAct与一个按钮对应    connect(mybundl,SIGNAL(mysigl()),this,SLOT(densepoint()));    bdthread->start(); void MainWindow::densepoint(){    bool fanhui;    while(true)    {        delCurrentMesh();        fanhui = importMesh( "F:/points.ply");        Sleep(2000);    }}可以这么说,在线程执行 BundlerApp::RunBundler();时,主线程也在执行一段代码。然后程序显示detected memory leaks dumping objects QObject::killTimers: timers cannot be stopped from another thread 我想问下最后这句话暗含了什么信息?
...全文
500 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

473

社区成员

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

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