Qt_multi_thread:qt开始野马子线程,主程序睡眠了子线程还在跑

时间:2021-03-06 19:36:29
【文件属性】:
文件名称:Qt_multi_thread:qt开始野马子线程,主程序睡眠了子线程还在跑
文件大小:3KB
文件格式:ZIP
更新时间:2021-03-06 19:36:29
C++ Qt_multi_thread qt开始野马子线程,主程序睡眠了子线程还在跑。 1依赖 QT += concurrent #include //要记得添加该头文件 2:用法 ①类声明 class my_qth { public: int img=0; int result1; int result2; void f1(); void f2(); void star1();//多线程启动函数,在原有的代码基础上增加该函数 void star2();//多线程启动函数,在原有的代码基础上增加该函数 void star_all(); }; ②类函数实现 void my_qth::f1() { qDebug()<<"f1_id___###"<<QThread::currentThreadId();
【文件预览】:
Qt_multi_thread-main
----qthread_2.pro(587B)
----my_th.cpp(1KB)
----README.md(1KB)
----main.cpp(603B)
----my_th.h(374B)

网友评论