qtmobility/examples/sensors/panorama/timedcontroller.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
     3 #include "inputcontroller.h"
     3 #include "inputcontroller.h"
     4 #include "timedcontroller.h"
     4 #include "timedcontroller.h"
     5 #include <QTime>
     5 #include <QTime>
     6 #include <QDebug>
     6 #include <QDebug>
     7 
     7 
     8 TimedController::TimedController( ): m_delay(10){ m_exTime = QTime::currentTime(); }
     8 TimedController::TimedController(): m_delay(10), m_interval(0){
     9 
     9     m_exTime = QTime::currentTime();
    10 void TimedController::startTimer()
    10     m_exTimestamp =QTime::currentTime();
    11 {
       
    12     m_timer.setSingleShot(false);
    11     m_timer.setSingleShot(false);
    13     m_timer.start(m_delay);
    12     m_timer.start(m_delay);
    14     connect(&m_timer, SIGNAL(timeout()), this, SLOT(handleTimedUpdate()));
    13     connect(&m_timer, SIGNAL(timeout()), this, SLOT(handleTimedUpdate()));
       
    14 
    15 }
    15 }
    16 
    16 
    17 void TimedController::stopTimer(){ m_timer.stop();}
    17 TimedController::~TimedController(){
       
    18     m_timer.stop();
       
    19     disconnect(&m_timer);
       
    20 }
    18 
    21 
    19 
    22 
    20 void TimedController::handleTimedUpdate()
    23 void TimedController::handleTimedUpdate()
    21 {
    24 {
    22     int timeDiff = m_exTime.msecsTo(QTime::currentTime());
    25     int timeDiff = m_exTime.msecsTo(QTime::currentTime());
    24     updateCoordinates();
    27     updateCoordinates();
    25     m_exTime = QTime::currentTime();
    28     m_exTime = QTime::currentTime();
    26 }
    29 }
    27 
    30 
    28 
    31 
    29 void TimedController::updateCoordinates(){}
       
    30