diff -r 000000000000 -r 876b1a06bc25 examples/sensors/panorama/timedcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/sensors/panorama/timedcontroller.cpp Wed Aug 25 15:49:42 2010 +0300 @@ -0,0 +1,31 @@ + + +#include "inputcontroller.h" +#include "timedcontroller.h" +#include +#include + +TimedController::TimedController(): m_delay(10), m_interval(0){ + m_exTime = QTime::currentTime(); + m_exTimestamp =QTime::currentTime(); + m_timer.setSingleShot(false); + m_timer.start(m_delay); + connect(&m_timer, SIGNAL(timeout()), this, SLOT(handleTimedUpdate())); + +} + +TimedController::~TimedController(){ + m_timer.stop(); + disconnect(&m_timer); +} + + +void TimedController::handleTimedUpdate() +{ + int timeDiff = m_exTime.msecsTo(QTime::currentTime()); + if (timeDiff< m_delay) return; + updateCoordinates(); + m_exTime = QTime::currentTime(); +} + +