|
yafeilinux 发表于 2014-5-26 20:42
使用定时器来完成啊。
具体咋弄 我写了很多次 都没成功- void QTcpSocketThread::sendQueryValueCmd()//
- {
- if(qureyReady)
- {
- QSensor* sensor = sensorsVector.at( currentQueryIndx );
- sensor->queryValueCmd(cmdBuffer);
- tcpSocket->write( cmdBuffer );
- }
- timer=new QTimer();
- timer->start(3000);
- timer->moveToThread(this);
- connect(timer,SIGNAL(timeout()),this,SLOT(sendQueryNextSensorValueCmd()),Qt::DirectConnection);
- }
复制代码 这么写不行的 |
|