本文整理汇总了C++中QTimer::property方法的典型用法代码示例。如果您正苦于以下问题:C++ QTimer::property方法的具体用法?C++ QTimer::property怎么用?C++ QTimer::property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTimer
的用法示例。
在下文中一共展示了QTimer::property方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: promiseCleanupTimeout
void ToxTunBase::promiseCleanupTimeout()
{
QTimer *timer = (QTimer*)sender();
QVariant vchan = timer->property("chan");
ToxTunChannel *chan = (ToxTunChannel*)vchan.value<void*>();
qDebug()<<timer<<chan<<chan->m_conid;
this->promiseChannelCleanup(chan);
}
示例2: ReleaseMessage
void Btowngtw::receiveCMD(QString value, QString key) {
qDebug() << m_gtwID << " Receive command from Gateway: " << value;
PlantMessage myMsg;
SysError theSysError;
if(OpenMsg::parse(value, myMsg)) {
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(stopTimer()));
timer->setSingleShot(true);
int msgID = qrand() % ((MAX_TIMER_ID + 1) - 0) + 0;
m_timeoutMap.insert(msgID, key);
timer->setProperty(TIMER_ID.toStdString().c_str(), msgID);
timer->setProperty(TYPE.toStdString().c_str(), sender()->property(TYPE.toStdString().c_str()).toString());
timer->setProperty(FRAME_TYPE.toStdString().c_str(), OpenMsg::getFrameType(value));
qDebug() << " timer getProperty: " << sender()->property(TYPE.toStdString().c_str()).toString() << " " << timer->property(TYPE.toStdString().c_str()).toString();
timer->start(TIMEOUT);
qDebug() << m_gtwID << " Parsing ok, emit sendCommand Signal";
myMsg.setSourceAddr(QPair<QString, QString>(PlantMessage::EXTERNAL, key), true);
myMsg.setDestAddr(QPair<QString, QString>(PlantMessage::INTERNAL, PlantMessage::DEVICE), true);
myMsg.setType(sender()->property(TYPE.toStdString().c_str()).toString());
myMsg.setId(msgID);
emit ReleaseMessage(myMsg, theSysError);
}
else {
qDebug() << m_gtwID << " Receive command from Gateway is WRONG FORMAT";
}
}