问题:
qt程序报错:QObject::startTimer: Timers can only be used with threads started with QThread
原因:
定时器启动函数startTimer的调用操作必须是在main函数中app定义的后面,如下:
QGuiApplication app(argc, argv);
// 定时器启动函数必须在app后调用
timer.startTimer(3000);
问题:
qt程序报错:QObject::startTimer: Timers can only be used with threads started with QThread
原因:
定时器启动函数startTimer的调用操作必须是在main函数中app定义的后面,如下:
QGuiApplication app(argc, argv);
// 定时器启动函数必须在app后调用
timer.startTimer(3000);