init branch
This commit is contained in:
@ -3,8 +3,7 @@
|
||||
AlarmTime::AlarmTime(const QTime time, QObject *parent) : QObject(parent), time_(time)
|
||||
{
|
||||
connect(&timer, SIGNAL(timeout()), this, SLOT(doTick()));
|
||||
timer.setInterval(500);
|
||||
|
||||
timer.setInterval(1000);
|
||||
}
|
||||
|
||||
AlarmTime::~AlarmTime()
|
||||
@ -15,21 +14,16 @@ AlarmTime::~AlarmTime()
|
||||
void AlarmTime::run()
|
||||
{
|
||||
abort();
|
||||
loop.reset(new QEventLoop);
|
||||
|
||||
timer.start();
|
||||
|
||||
qDebug()<<"Start Alarm Time Manager\n";
|
||||
loop->exec();
|
||||
}
|
||||
|
||||
|
||||
void AlarmTime::abort()
|
||||
{
|
||||
timer.stop();
|
||||
if (!loop.isNull()){
|
||||
loop->quit();
|
||||
}
|
||||
qDebug()<<"Stop Alarm Time Manager\n";
|
||||
}
|
||||
|
||||
@ -37,7 +31,7 @@ void AlarmTime::doTick()
|
||||
{
|
||||
if(time_.hour() == QTime::currentTime().hour() && time_.minute() == QTime::currentTime().minute() && triggerd_==false )
|
||||
{
|
||||
qDebug()<<"Trigger\n";
|
||||
qDebug()<<"Trigger\n";
|
||||
triggerd_=true;
|
||||
trigger();
|
||||
}
|
||||
|
Reference in New Issue
Block a user