Add shutdown widget.

This commit is contained in:
sunwen
2023-09-11 16:29:30 +08:00
parent ae1b063b72
commit 2bbef648f5
10 changed files with 140 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ DmsAsyncAction::DmsAsyncAction(int aServerId, int aActionId, QObject* aObject, c
, mSendData()
{
mTimer->setSingleShot(true);
mTimer->setInterval(TIMEOUT_MSEC);
connect(mTimer, &QTimer::timeout, this, &DmsAsyncAction::sendTimeoutSignal);
connect(mObject, ("2" + mResponseSignal).toStdString().c_str(), mTimer, SLOT(stop()));
}
@@ -36,7 +37,7 @@ bool DmsAsyncAction::execute()
{
return false;
}
mTimer->start(TIMEOUT_MSEC);
mTimer->start();
return true;
}
@@ -44,3 +45,8 @@ void DmsAsyncAction::sendTimeoutSignal()
{
emit timeout();
}
void DmsAsyncAction::setTimeoutInterval(int aMsec)
{
mTimer->setInterval(aMsec);
}