src/hbcore/gestures/hbpangesture.cpp
changeset 34 ed14f46c0e55
parent 6 c3690ec91ef8
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    21 ** If you have questions regarding the use of this file, please contact
    21 ** If you have questions regarding the use of this file, please contact
    22 ** Nokia at developer.feedback@nokia.com.
    22 ** Nokia at developer.feedback@nokia.com.
    23 **
    23 **
    24 ****************************************************************************/
    24 ****************************************************************************/
    25 
    25 
       
    26 #include "hbpangesture.h"
       
    27 
    26 #include "hbgestures_p.h"
    28 #include "hbgestures_p.h"
    27 #include "hbpangesture.h"
       
    28 #include "hbpangesture_p.h"
       
    29 #include "hbvelocitycalculator_p.h"
    29 #include "hbvelocitycalculator_p.h"
    30 
    30 
    31 #include <QPointF>
    31 #include <QPointF>
    32 #include <QVariant>
    32 #include <QVariant>
    33 #include <QDebug>
    33 #include <QDebug>
   125     \param parent Owner for gesture
   125     \param parent Owner for gesture
   126 
   126 
   127 */
   127 */
   128 HbPanGesture::HbPanGesture(QObject *parent) : QPanGesture(parent), d_ptr(new HbPanGesturePrivate)
   128 HbPanGesture::HbPanGesture(QObject *parent) : QPanGesture(parent), d_ptr(new HbPanGesturePrivate)
   129 {
   129 {
   130     d_ptr->q_ptr = this;
   130     d_ptr->mIgnoreMouseEvents = false;
       
   131     d_ptr->mTime.start();
       
   132     d_ptr->mFollowedTouchPointId = -1;
   131 }
   133 }
   132 
   134 
   133 /*!
   135 /*!
   134     Constructor required by the shared d-pointer paradigm.
   136     Constructor required by the shared d-pointer paradigm.
   135     \param dd Private data
   137     \param dd Private data
   136     \param parent Owner for gesture
   138     \param parent Owner for gesture
   137 
   139 
   138 */
   140 */
   139 HbPanGesture::HbPanGesture( HbPanGesturePrivate &dd, QObject *parent )
   141 HbPanGesture::HbPanGesture( HbPanGesturePrivate &dd, QObject *parent )
   140     : QPanGesture(parent), d_ptr( &dd )
   142     : QPanGesture(parent), d_ptr(&dd)
   141 {
   143 {
   142     d_ptr->q_ptr = this;
   144     hbWarning("Shared private not supported for HbPanGesture");
   143 }
   145 }
   144 
   146 
   145 /*!
   147 /*!
   146     Destructor.
   148     Destructor.
   147 */
   149 */
   178     \sa setVelocity(), sceneVelocity()
   180     \sa setVelocity(), sceneVelocity()
   179 */
   181 */
   180 QPointF HbPanGesture::velocity() const
   182 QPointF HbPanGesture::velocity() const
   181 {
   183 {
   182     Q_D(const HbPanGesture);
   184     Q_D(const HbPanGesture);
   183     return HbVelocityCalculator( d->mAxisX, d->mAxisY ).velocity(QTime::currentTime());
   185     return HbVelocityCalculator( d->mAxisX, d->mAxisY ).velocity( d->mLastTimeStamp );
   184 }
   186 }
   185 
   187 
   186 /*!
   188 /*!
   187     Sets the panning velocity in global coordinates.
   189     Sets the panning velocity in global coordinates.
   188     This function is used by the framework gesture recognition logic,
   190     This function is used by the framework gesture recognition logic,