qtmobility/examples/sensors/panorama/timedcontroller.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 23 Jun 2010 19:08:38 +0300
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
permissions -rw-r--r--
Revision: 201023 Kit: 2010125



#include "inputcontroller.h"
#include "timedcontroller.h"
#include <QTime>
#include <QDebug>

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();
}