Qt_multi_thread:qt开始野马子线程主程序睡眠了子线程还在跑 源码
Qt_multi_thread qt开始野马子线程,主程序睡眠了子线程还在跑。 1依赖 QT += concurrent #include //要记得添加该头文件 2:用法 1类声明 class my_qth { public: int img=0; int result1; int result2; void f1(); void f2(); void star1();//多线程启动函数,在原有的代码基础上增加该函数 void star2();//多线程启动函数,在原有的代码基础上增加该函数 void star_all(); }; 2类函数实现 void my_qth::f1() { qDebug()<<"f1_id___###"<<QThread::currentThreadId();
下载地址
用户评论