2013-03-15 13:11:33 +00:00
|
|
|
namespace phoenix {
|
|
|
|
|
2011-06-05 03:45:04 +00:00
|
|
|
void pTimer::setEnabled(bool enabled) {
|
|
|
|
if(enabled) {
|
|
|
|
qtTimer->start();
|
|
|
|
} else {
|
|
|
|
qtTimer->stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTimer::setInterval(unsigned milliseconds) {
|
|
|
|
qtTimer->setInterval(milliseconds);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTimer::constructor() {
|
|
|
|
qtTimer = new QTimer;
|
|
|
|
qtTimer->setInterval(0);
|
2013-03-15 13:11:33 +00:00
|
|
|
connect(qtTimer, SIGNAL(timeout()), SLOT(onActivate()));
|
2011-06-05 03:45:04 +00:00
|
|
|
}
|
|
|
|
|
2011-09-05 03:48:23 +00:00
|
|
|
void pTimer::destructor() {
|
|
|
|
delete qtTimer;
|
|
|
|
}
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
void pTimer::onActivate() {
|
|
|
|
if(timer.onActivate) timer.onActivate();
|
|
|
|
}
|
|
|
|
|
2011-06-05 03:45:04 +00:00
|
|
|
}
|