jjzjj

NotificationTimer

全部标签

c++ - QT 线程:获取 QObject::startTimer:定时器不能从另一个线程警告启动

我按照QtSDK中的示例,在QThread子类中启动计时器但我不断收到警告,线程永远不会启动计时器。这是代码:NotificationThread::NotificationThread(QObject*parent):QThread(parent),m_timerInterval(0){moveToThread(this);}NotificationThread::~NotificationThread(){;}voidNotificationThread::fire(){WRITELOG("A::firecalled--currentThread:"+QString::number