常用函数

  • 睡眠

https://blog.csdn.net/yihui8/article/details/41776323

QT提供了sleep QThread::sleep(500);

或者,用QT的系统调用,然而每个系统中都有Sleep()函数,所以可以简单的包含系统头文件即可。

如果是**windows**平台则:

#include <windows.h>
就可以用Sleep()了:

Sleep(10000);
(注意是大写S)

**linux**下头文件是:

#include <sys/stat.h>

报错

  • QObject: Cannot create children for a parent that is in a different thread. (Parent is QSerialPort(0x54bc3f0), parent's thread is QThread(0x1999fc0), current thread is QThread(0x51f6430)
    https://linuxcpp.0voice.com/?id=121385
分类: 线程

0 条评论

发表回复

您的电子邮箱地址不会被公开。