qtmobility/examples/sensors/panorama/timedcontroller.cpp
changeset 11 06b8e2af4411
child 14 6fbed849b4f4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/examples/sensors/panorama/timedcontroller.cpp	Fri Jun 11 14:26:25 2010 +0300
@@ -0,0 +1,30 @@
+
+
+#include "inputcontroller.h"
+#include "timedcontroller.h"
+#include <QTime>
+#include <QDebug>
+
+TimedController::TimedController( ): m_delay(10){ m_exTime = QTime::currentTime(); }
+
+void TimedController::startTimer()
+{
+    m_timer.setSingleShot(false);
+    m_timer.start(m_delay);
+    connect(&m_timer, SIGNAL(timeout()), this, SLOT(handleTimedUpdate()));
+}
+
+void TimedController::stopTimer(){ m_timer.stop();}
+
+
+void TimedController::handleTimedUpdate()
+{
+    int timeDiff = m_exTime.msecsTo(QTime::currentTime());
+    if (timeDiff<  m_delay) return;
+    updateCoordinates();
+    m_exTime = QTime::currentTime();
+}
+
+
+void TimedController::updateCoordinates(){}
+