diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2012-07-06 13:52:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-16 05:50:03 +0200 |
commit | 6765fb158c3db30b9fd91b8be633b578595c3443 (patch) | |
tree | 7eb8cb374f50a8bc62907e3be8bd0013814708dc | |
parent | b92007ecf9fff823a6b330ecac917fe2e7e87336 (diff) | |
download | qtlocation-6765fb158c3db30b9fd91b8be633b578595c3443.tar.gz |
Remove deprecated MapPinchArea and MapFlickable elements.
They are replaced by the MapGestureArea element.
Change-Id: Ib58fa00e81eea728e6d28e91faee99ef6d22b43a
Reviewed-by: Alex <alex.blasche@nokia.com>
-rw-r--r-- | src/imports/location/location.cpp | 4 | ||||
-rw-r--r-- | src/imports/location/location.pro | 4 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomap.cpp | 40 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomap_p.h | 11 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomapflickable.cpp | 164 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomapflickable_p.h | 96 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomapgesturearea.cpp | 18 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomapgesturearea_p.h | 19 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomappincharea.cpp | 267 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomappincharea_p.h | 153 |
10 files changed, 4 insertions, 772 deletions
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp index a23a8155..379621fc 100644 --- a/src/imports/location/location.cpp +++ b/src/imports/location/location.cpp @@ -58,8 +58,6 @@ #include "qdeclarativegeoroutemodel_p.h" #include "qdeclarativegeocodemodel_p.h" #include "qdeclarativegeomaneuver_p.h" -#include "qdeclarativegeomapflickable_p.h" -#include "qdeclarativegeomappincharea_p.h" #include "qdeclarativegeomapquickitem_p.h" #include "qdeclarativegeomapitemview_p.h" #include "qdeclarativegeomaptype_p.h" @@ -134,8 +132,6 @@ public: qmlRegisterType<QDeclarativeGeoRoute>(uri, 5, 0, "Route"); // data type qmlRegisterType<QDeclarativeGeoRouteSegment>(uri, 5, 0, "RouteSegment"); qmlRegisterType<QDeclarativeGeoManeuver>(uri, 5, 0, "RouteManeuver"); - qmlRegisterUncreatableType<QDeclarativeGeoMapFlickable>(uri, 5, 0, "MapFlickable", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Map)Flickable")); - qmlRegisterUncreatableType<QDeclarativeGeoMapPinchArea>(uri, 5, 0, "MapPinchArea", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Map)PinchArea")); qmlRegisterUncreatableType<QDeclarativeGeoMapPinchEvent>(uri, 5, 0, "MapPinchEvent", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Map)PinchEvent")); qmlRegisterUncreatableType<QDeclarativeGeoMapGestureArea>(uri, 5, 0, "MapGestureArea", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Map)GestureArea")); qmlRegisterUncreatableType<QDeclarativeGeoMapType>(uri, 5, 0, "MapType", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("MapType")); diff --git a/src/imports/location/location.pro b/src/imports/location/location.pro index f7388b3d..f61f7a21 100644 --- a/src/imports/location/location.pro +++ b/src/imports/location/location.pro @@ -33,8 +33,6 @@ HEADERS += qdeclarativeposition_p.h \ qdeclarativegeoroutesegment_p.h \ qdeclarativegeomaneuver_p.h \ qdeclarativegeomap_p.h \ - qdeclarativegeomapflickable_p.h \ - qdeclarativegeomappincharea_p.h \ qdeclarativegeomaptype_p.h \ qdeclarativegeomapitembase_p.h \ qdeclarativegeomapquickitem_p.h \ @@ -68,8 +66,6 @@ SOURCES += qdeclarativeposition.cpp \ qdeclarativegeoroutesegment.cpp \ qdeclarativegeomaneuver.cpp \ qdeclarativegeomap.cpp \ - qdeclarativegeomapflickable.cpp \ - qdeclarativegeomappincharea.cpp \ qdeclarativegeomaptype.cpp \ qdeclarativegeomapitembase.cpp \ qdeclarativegeomapquickitem.cpp \ diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index 3eb846b8..82037021 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -194,8 +194,6 @@ QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent) activeMapType_(0), componentCompleted_(false), mappingManagerInitialized_(false), - flickable_(0), - pinchArea_(0), canvas_(0), touchTimer_(-1), map_(0) @@ -209,8 +207,6 @@ QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent) // Create internal flickable and pinch area. gestureArea_ = new QDeclarativeGeoMapGestureArea(this, this); - flickable_ = new QDeclarativeGeoMapFlickable(this, gestureArea_); - pinchArea_ = new QDeclarativeGeoMapPinchArea(this, gestureArea_); } QDeclarativeGeoMap::~QDeclarativeGeoMap() @@ -372,32 +368,6 @@ QDeclarativeGeoMapGestureArea *QDeclarativeGeoMap::gesture() } /*! - \qmlproperty MapPinchArea QtLocation5::Map::pinch - - Contains the MapPinchArea created with the Map. Use \c{pinch.enabled: true} - to enable basic pinch gestures, or see \l{MapPinchArea} for further details. - This object will be deprecated, use the gesture object instead. -*/ - -QDeclarativeGeoMapPinchArea *QDeclarativeGeoMap::pinch() -{ - return pinchArea_; -} - -/*! - \qmlproperty MapFlickable QtLocation5::Map::flick - - Contains the MapFlickable created with the Map. Use \c{flick.enabled: true} - to enable basic flick gestures, or see \l{MapFlickable} for further details. - This object will be deprecated, use the gesture object instead. -*/ - -QDeclarativeGeoMapFlickable *QDeclarativeGeoMap::flick() -{ - return flickable_; -} - -/*! \internal */ void QDeclarativeGeoMap::itemChange(ItemChange change, const ItemChangeData & data) @@ -500,12 +470,11 @@ void QDeclarativeGeoMap::mappingManagerInitialized() mappingManagerInitialized_ = true; map_ = mappingManager_->createMap(this); - flickable_->setMap(map_); - pinchArea_->zoomLevelLimits(mappingManager_->cameraCapabilities().minimumZoomLevel(), mappingManager_->cameraCapabilities().maximumZoomLevel()); + gestureArea_->setMap(map_); + gestureArea_->zoomLevelLimits(mappingManager_->cameraCapabilities().minimumZoomLevel(), + mappingManager_->cameraCapabilities().maximumZoomLevel()); map_->setActiveMapType(QGeoMapType()); - flickable_->setMap(map_); - pinchArea_->setMap(map_); copyrightsWPtr_ = new QDeclarativeGeoMapCopyrightNotice(this); connect(map_, @@ -513,9 +482,6 @@ void QDeclarativeGeoMap::mappingManagerInitialized() copyrightsWPtr_.data(), SLOT(copyrightsChanged(const QImage &, const QPoint &))); - pinchArea_->zoomLevelLimits(mappingManager_->cameraCapabilities().minimumZoomLevel(), - mappingManager_->cameraCapabilities().maximumZoomLevel()); - QGeoCameraCapabilities capabilities = mappingManager_->cameraCapabilities(); if (zoomLevel_ < capabilities.minimumZoomLevel()) setZoomLevel(capabilities.minimumZoomLevel()); diff --git a/src/imports/location/qdeclarativegeomap_p.h b/src/imports/location/qdeclarativegeomap_p.h index 43ff872f..eccf6e96 100644 --- a/src/imports/location/qdeclarativegeomap_p.h +++ b/src/imports/location/qdeclarativegeomap_p.h @@ -54,8 +54,6 @@ #include <QtQml/QQmlParserStatus> #include "qdeclarativegeomapitemview_p.h" #include "qdeclarativegeomapgesturearea_p.h" -#include "qdeclarativegeomapflickable_p.h" -#include "qdeclarativegeomappincharea_p.h" #include "qgeomapcontroller_p.h" #include "qdeclarativegeomapcopyrightsnotice_p.h" @@ -102,8 +100,6 @@ class QDeclarativeGeoMap : public QQuickItem Q_OBJECT Q_PROPERTY(QDeclarativeGeoMapGestureArea *gesture READ gesture CONSTANT) - Q_PROPERTY(QDeclarativeGeoMapPinchArea *pinch READ pinch CONSTANT) - Q_PROPERTY(QDeclarativeGeoMapFlickable *flick READ flick CONSTANT) Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged) Q_PROPERTY(qreal minimumZoomLevel READ minimumZoomLevel NOTIFY minimumZoomLevelChanged) Q_PROPERTY(qreal maximumZoomLevel READ maximumZoomLevel NOTIFY maximumZoomLevelChanged) @@ -140,8 +136,6 @@ public: qreal minimumZoomLevel() const; qreal maximumZoomLevel() const; - QDeclarativeGeoMapFlickable *flick(); - void setZoomLevel(qreal zoomLevel); qreal zoomLevel() const; @@ -167,7 +161,6 @@ public: // callback for map mouse areas bool mouseEvent(QMouseEvent *event); - QDeclarativeGeoMapPinchArea *pinch(); QDeclarativeGeoMapGestureArea *gesture(); Q_INVOKABLE void fitViewportToMapItems(); @@ -230,8 +223,6 @@ private: QList<QDeclarativeGeoMapItemView *> mapViews_; QDeclarativeGeoMapGestureArea *gestureArea_; - QDeclarativeGeoMapFlickable *flickable_; - QDeclarativeGeoMapPinchArea *pinchArea_; void paintGL(QGLPainter *painter); void earlyDraw(QGLPainter *painter); @@ -249,8 +240,6 @@ private: friend class QDeclarativeGeoMapItem; friend class QDeclarativeGeoMapItemView; friend class QDeclarativeGeoMapGestureArea; - friend class QDeclarativeGeoMapPinchArea; - friend class QDeclarativeGeoMapFlickable; Q_DISABLE_COPY(QDeclarativeGeoMap) }; diff --git a/src/imports/location/qdeclarativegeomapflickable.cpp b/src/imports/location/qdeclarativegeomapflickable.cpp deleted file mode 100644 index f59a4e24..00000000 --- a/src/imports/location/qdeclarativegeomapflickable.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui/QGuiApplication> -#include "qdeclarativegeomapflickable_p.h" -#include "qdeclarativegeomapgesturearea_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \qmlclass MapFlickable QDeclarativeGeoMapFlickable - - \inqmlmodule QtLocation 5.0 - - \brief The MapFlickable element provides basic flicking of the Map. - - MapFlickable elements are used as part of a Map, to provide for the common - flick gesture that pans the map in an intuitive fashion. This is comparable - to the activity of the \l Flickable element. - - A MapFlickable is automatically created with a new Map and available with - the \l{QtLocation5::Map::flick}{flick} property. This is the only way - to create a MapFlickable, and once created this way cannot be destroyed - without its parent Map. - - The two most commonly used properties of the MapFlickable are \l enabled and - \l deceleration. The former must be set in order for the MapFlickable to - have any effect upon its parent Map. The latter property customizes the - response of the MapFlickable to input from the user, by adjusting how much - "friction" slows down the flick after the user has raised their finger - or released the mouse button. - - \section2 Performance - - The MapFlickable, when enabled, must process all incoming touch or cursor - movement events in order to build up the "flick" gesture, and then complete - an animation for the "deceleration" phase. The MapFlickable builds up a - buffer of samples during the motion capture phase: currently a maximum of - 3 past samples are processed at each new event. As a result, the overhead - on movement events can be considered constant time, as there are many more - than 3 events in a typical gesture. The cost of animation is identical to - two parallel double float \l{QPropertyAnimation}{QPropertyAnimations} with - OutQuad easing curves. - - \section2 Example Usage - - The following example enables the flick gesture on a map, and sets the - deceleration/friction value to be double its standard level. - - \code - Map { - flick.enabled: true - flick.deceleration: 5000 - } - \endcode - - \ingroup qml-QtLocation5-maps - \since Qt Location 5.0 -*/ - -/*! - \qmlproperty bool QtLocation5::MapFlickable::enabled - - This property holds whether the flicking is enabled. - By default flicking is enabled. Disabling flicking will terminate - any potentially active flicks (movement or actual flick). -*/ - -/*! - \qmlproperty real QtLocation5::MapFlickable::deceleration - - This property holds the rate at which a flick will decelerate. The - larger the value, the faster the flick decelerates. - Default value is 2500, minimum value is 500 and maximum value is 10000. -*/ - -/*! - \qmlsignal QtLocation5::MapFlickable::onMovementStarted() - - This handler is called when the view begins moving due to user - interaction. Typically this means that the user is dragging a finger - - or a mouse with one of more mouse buttons pressed - on the map. -*/ - -/*! - \qmlsignal QtLocation5::MapFlickable::onMovementEnded() - - This handler is called when the view stops moving due to user - interaction. If a flick was generated, this handler will - be triggered once the flick stops. If a flick was not - generated, the handler will be triggered when the - user stops dragging - that is a mouse or touch release. - -*/ - -/*! - \qmlsignal QtLocation5::MapFlickable::onFlickStarted() - - This handler is called when the view is flicked. A flick - starts from the point that the mouse or touch is released, - while still in motion. -*/ - -/*! - \qmlsignal QtLocation5::MapFlickable::onFlickEnded() - - This handler is called when the view stops moving due to a flick. - The order of onMovementEnded() and onFlickEnded() is not specified. -*/ - -QDeclarativeGeoMapFlickable::QDeclarativeGeoMapFlickable(QObject *parent, - QDeclarativeGeoMapGestureArea *gestureArea) - : QObject(parent), - gestureArea_(gestureArea) -{ - gestureArea_->registerFlickDeprecated(this); -} - -QDeclarativeGeoMapFlickable::~QDeclarativeGeoMapFlickable() -{ -} - -#include "moc_qdeclarativegeomapflickable_p.cpp" - -QT_END_NAMESPACE diff --git a/src/imports/location/qdeclarativegeomapflickable_p.h b/src/imports/location/qdeclarativegeomapflickable_p.h deleted file mode 100644 index c2e5252b..00000000 --- a/src/imports/location/qdeclarativegeomapflickable_p.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEGEOMAPFLICKABLE_H -#define QDECLARATIVEGEOMAPFLICKABLE_H - - -#include <QtQml/qqml.h> -#include <QtGui/qevent.h> -#include <QElapsedTimer> -#include <QVector> -#include <QObject> -#include <QDebug> -#include "qdeclarativegeomapgesturearea_p.h" - -QT_BEGIN_NAMESPACE - -class QGraphicsSceneMouseEvent; -class QPropertyAnimation; -class QGeoCameraData; -class QGeoMap; - -// Note: this class will be deprecated in future versions, it remains as a wrapper -// Please use the gesture object instead. -class QDeclarativeGeoMapFlickable: public QObject -{ - Q_OBJECT - Q_PROPERTY(qreal deceleration READ deceleration WRITE setDeceleration NOTIFY decelerationChanged) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged()) - -public: - QDeclarativeGeoMapFlickable(QObject *parent, QDeclarativeGeoMapGestureArea *gestureArea_); - ~QDeclarativeGeoMapFlickable(); - - qreal deceleration() const { return gestureArea_->flickDeceleration(); } - void setDeceleration(qreal deceleration) { gestureArea_->setFlickDeceleration(deceleration); } - - bool enabled() const { return gestureArea_->panEnabled(); } - void setEnabled(bool enabled) { gestureArea_->setPanEnabled(enabled); } - - void setMap(QGeoMap *map) { gestureArea_->setMap(map); } - -Q_SIGNALS: - void decelerationChanged(); - void enabledChanged(); - void movementStarted(); - void movementEnded(); - void flickStarted(); - void flickEnded(); - -private: - QDeclarativeGeoMapGestureArea *gestureArea_; // the destination for this wrapper class -}; - -QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeGeoMapFlickable); - -#endif diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp index b00b5573..ab5f33c8 100644 --- a/src/imports/location/qdeclarativegeomapgesturearea.cpp +++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp @@ -391,7 +391,6 @@ void QDeclarativeGeoMapGestureArea::setActiveGestures(ActiveGestures activeGestu if (activeGestures_ & TiltGesture) qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PINCH_TILT_GESTURE_ACTIVATED); emit activeGesturesChanged(); - emit pinchDep_->activeGesturesChanged(); } /*! @@ -447,7 +446,6 @@ void QDeclarativeGeoMapGestureArea::setPinchEnabled(bool enabled) return; pinch_.enabled = enabled; emit pinchEnabledChanged(); - emit pinchDep_->enabledChanged(); } /*! @@ -467,7 +465,6 @@ void QDeclarativeGeoMapGestureArea::setPanEnabled(bool enabled) return; pan_.enabled_ = enabled; emit panEnabledChanged(); - emit flickableDep_->enabledChanged(); // unlike the pinch, the pan existing functionality is to stop immediately if (!enabled) @@ -505,7 +502,6 @@ void QDeclarativeGeoMapGestureArea::setMaximumZoomLevelChange(qreal maxChange) return; pinch_.zoom.maximumChange = maxChange; emit maximumZoomLevelChangeChanged(); - emit pinchDep_->maximumZoomLevelChangeChanged(); } /*! @@ -525,7 +521,6 @@ void QDeclarativeGeoMapGestureArea::setRotationFactor(qreal factor) return; pinch_.rotation.factor = factor; emit rotationFactorChanged(); - emit pinchDep_->rotationFactorChanged(); } /*! @@ -549,7 +544,6 @@ void QDeclarativeGeoMapGestureArea::setFlickDeceleration(qreal deceleration) return; pan_.deceleration_ = deceleration; emit flickDecelerationChanged(); - emit flickableDep_->decelerationChanged(); } /*! @@ -825,7 +819,6 @@ void QDeclarativeGeoMapGestureArea::setPinchActive(bool active) if ((active && pinchState_ == pinchActive) || (!active && pinchState_ != pinchActive)) return; pinchState_ = active ? pinchActive : pinchInactive; - emit pinchDep_->activeChanged(); emit pinchActiveChanged(); } @@ -886,7 +879,6 @@ bool QDeclarativeGeoMapGestureArea::canStartPinch() pinch_.event.setPointCount(touchPoints_.count()); pinch_.event.setAccepted(true); emit pinchStarted(&pinch_.event); - emit pinchDep_->pinchStarted(&pinch_.event); return pinch_.event.accepted(); } } @@ -946,7 +938,6 @@ void QDeclarativeGeoMapGestureArea::updatePinch() pinch_.lastAngle = twoTouchAngle_; emit pinchUpdated(&pinch_.event); - emit pinchDep_->pinchUpdated(&pinch_.event); if (activeGestures_ & ZoomGesture) { // Take maximum and minimumzoomlevel into account @@ -1001,7 +992,6 @@ void QDeclarativeGeoMapGestureArea::endPinch() pinch_.event.setAccepted(true); pinch_.event.setPointCount(0); emit pinchFinished(&pinch_.event); - emit pinchDep_->pinchFinished(&pinch_.event); pinch_.startDist = 0; } @@ -1044,10 +1034,8 @@ void QDeclarativeGeoMapGestureArea::panStateMachine() case panActive: updatePan(); // this ensures 'panStarted' occurs after the pan has actually started - if (lastState != panActive) { + if (lastState != panActive) emit panStarted(); - emit flickableDep_->movementStarted(); - } break; case panFlick: break; @@ -1155,7 +1143,6 @@ void QDeclarativeGeoMapGestureArea::startFlick(int dx, int dy, int timeMs) pan_.animation_->setEndValue(QVariant::fromValue(animationEndCoordinate)); pan_.animation_->start(); emit flickStarted(); - emit flickableDep_->flickStarted(); } void QDeclarativeGeoMapGestureArea::stopPan() @@ -1167,7 +1154,6 @@ void QDeclarativeGeoMapGestureArea::stopPan() } else if (panState_ == panActive) { emit panFinished(); emit movementStopped(); - flickableDep_->movementEnded(); } panState_ = panInactive; } @@ -1178,11 +1164,9 @@ void QDeclarativeGeoMapGestureArea::stopPan() void QDeclarativeGeoMapGestureArea::endFlick() { emit panFinished(); - emit flickableDep_->movementEnded(); if (pan_.animation_->state() == QPropertyAnimation::Running) pan_.animation_->stop(); emit flickFinished(); - emit flickableDep_->flickEnded(); panState_ = panInactive; emit movementStopped(); } diff --git a/src/imports/location/qdeclarativegeomapgesturearea_p.h b/src/imports/location/qdeclarativegeomapgesturearea_p.h index 10bf2102..d84789c1 100644 --- a/src/imports/location/qdeclarativegeomapgesturearea_p.h +++ b/src/imports/location/qdeclarativegeomapgesturearea_p.h @@ -56,8 +56,6 @@ class QDeclarativeGeoMap; class QTouchEvent; class QGeoMap; class QPropertyAnimation; -class QDeclarativeGeoMapFlickable; -class QDeclarativeGeoMapPinchArea; class QDeclarativeGeoMapPinchEvent : public QObject { @@ -171,17 +169,6 @@ public: void zoomLevelLimits(qreal min, qreal max); void setMap(QGeoMap *map); - // will be removed - void registerFlickDeprecated(QDeclarativeGeoMapFlickable *flickable) - { - flickableDep_ = flickable; - } - - void registerPinchDeprecated(QDeclarativeGeoMapPinchArea *pinchArea) - { - pinchDep_ = pinchArea; - } - Q_SIGNALS: void pinchActiveChanged(); void enabledChanged(); @@ -204,9 +191,6 @@ Q_SIGNALS: void movementStopped(); private: - class QDeclarativeGeoMapFlickable *flickableDep_; - class QDeclarativeGeoMapPinchArea *pinchDep_; - void update(); // Create general data relating to the touch points @@ -334,9 +318,6 @@ private: panActive, panFlick } panState_; - - friend class QDeclarativeGeoMapPinchArea; - friend class QDeclarativeGeoMapFlickable; }; QT_END_NAMESPACE diff --git a/src/imports/location/qdeclarativegeomappincharea.cpp b/src/imports/location/qdeclarativegeomappincharea.cpp deleted file mode 100644 index 6ccafe0d..00000000 --- a/src/imports/location/qdeclarativegeomappincharea.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui/QGuiApplication> -#include "qdeclarativegeomappincharea_p.h" -#include "qdeclarativegeomap_p.h" -#include "qdeclarativecoordinate_p.h" -#include <QtGui/qevent.h> -#include <QtGui/QStyleHints> -#include <QtQml/qqmlinfo.h> -#include <QPropertyAnimation> -#include <QDebug> -#include "math.h" -#include "qgeomap_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmlclass MapPinchEvent QDeclarativeGeoMapPinchEvent - \inqmlmodule QtLocation 5.0 - - \brief MapPinchEvent element provides basic information about pinch event. - - MapPinchEvent element provides basic information about pinch event. They are - present in handlers of MapPinch (for example pinchStarted/pinchUpdated). Events are only - guaranteed to be valid for the duration of the handler. - - Except for the \l accepted property, all properties are read-only. - - \section2 Example Usage - - The following example enables the pinch gesture on a map and reacts to the - finished event. - - \code - Map { - id: map - pinch.enabled: true - pinch.onPinchFinished:{ - var coordinate1 = map.toCoordinate(pinch.point1) - var coordinate2 = map.toCoordinate(pinch.point2) - console.log("Pinch startet at:") - console.log(" Points (" + pinch.point1.x + ", " + pinch.point1.y + ") - (" + pinch.point2.x + ", " + pinch.point2.y + ")") - console.log(" Coordinates (" + coordinate1.latitude + ", " + coordinate1.longitude + ") - (" + coordinate2.latitude + ", " + coordinate2.longitude + ")") - } - } - \endcode - - \ingroup qml-QtLocation5-maps - \since Qt Location 5.0 -*/ - -/*! - \qmlproperty QPoint QtLocation5::MapPinchEvent::center - - This read-only property holds the current center point. -*/ - -/*! - \qmlproperty real QtLocation5::MapPinchEvent::angle - - This read-only property holds the current angle between the two points in - the range -180 to 180. Positive values for the angles mean counter-clockwise - while negative values mean the clockwise direction. Zero degrees is at the - 3 o'clock position. -*/ - -/*! - \qmlproperty QPoint QtLocation5::MapPinchEvent::point1 - \qmlproperty QPoint QtLocation5::MapPinchEvent::point2 - - These read-only properties hold the actual touch points generating the pinch. - The points are not in any particular order. -*/ - -/*! - \qmlproperty int QtLocation5::MapPinchEvent::pointCount - - This read-only property holds the number of points currently touched. - The MapPinch will not react until two touch points have initiated a gesture, - but will remain active until all touch points have been released. -*/ - -/*! - \qmlproperty bool QtLocation5::MapPinchEvent::accepted - - Setting this property to false in the \c MapPinch::onPinchStarted handler - will result in no further pinch events being generated, and the gesture - ignored. -*/ - -/*! - \qmlclass MapPinchArea QDeclarativeGeoMapPinchArea - - \inqmlmodule QtLocation 5.0 - - \brief The MapPinchArea element provides basic Map pinch interaction. - - MapPinchArea elements are used as part of a Map, to provide for the - pinch-to-zoom gesture used on touch displays. This is comparable to the - activity of the \l{PinchArea} element. - - A MapPinchArea is automatically created with a new Map and available with - the \l{QtLocation5::Map::pinch}{pinch} property. This is the only way - to create a MapPinchArea, and once created this way cannot be destroyed - without its parent Map. - - The two most commonly used properties of the MapPinchArea are the \l enabled - and \l activeGestures properties. Both of these must be set before a - MapPinchArea will have any effect upon interaction with the Map. - - \section2 Performance - - The MapPinchArea, when enabled, must process all incoming touch events in - order to track the shape and size of the "pinch". The overhead added on - touch events can be considered constant time. - - \section2 Example Usage - - The following example enables the pinch gesture on a map. - - \code - Map { - pinch.enabled: true - pinch.activeGestures: MapPinchArea.ZoomGesture - } - \endcode - - \ingroup qml-QtLocation5-maps - \since Qt Location 5.0 -*/ - -/*! - \qmlproperty bool QtLocation5::MapPinchArea::active - - This read-only property holds whether a pinch gesture is active. -*/ - -/*! - \qmlproperty enumeration QtLocation5::MapPinchArea::activeGestures - - This property holds the gestures that the pinch should control. By default - the MapPinchArea.ZoomGesture is enabled. - - \list - \li MapPinchArea.NoGesture - Don't support any additional gestures (value: 0x0000). - \li MapPinchArea.ZoomGesture - Support the map zoom gesture (value: 0x0001). - \li MapPinchArea.RotationGesture - Support the map rotation gesture (value: 0x0002). - \li MapPinchArea.TiltGesture - Support the map tilt gesture (value: 0x0004). - \li MapPinchArea.PanGesture - Support the map pan gesture while pinching (value: 0x0008). - \endlist - - For the extremist, one may OR flag the RotationGesture or TiltGesture - but these come with absolutely no warranty or guarantees at the moment - (may be removed, changed, moved around) - - \note For the time being, only MapPinchArea.ZoomGesture is supported. -*/ - -/*! - \qmlproperty real QtLocation5::MapPinchArea::maximumZoomLevelChange - - This property holds the maximum zoom level change per pinch, essentially - meant to be used for setting the zoom sensitivity. - - It is an indicative measure calculated from the dimensions of the - map area, roughly corresponding how much zoom level could change with - maximum pinch zoom. Default value is 2.0, maximum value is 10.0 -*/ - -/*! - \qmlproperty real MapPinchArea::rotationFactor - - This property holds the rotation factor for zoom, essentially meant to be used for setting - the rotation sensitivity. - - It is an indicative measure; the default value 1.0 means the map roughly follows the fingers, - whereas 2.0 means rotating twice as fast. Maximum value is 5.0. -*/ - -/*! - \qmlsignal QtLocation5::MapPinchArea::pinchStarted(PinchEvent event) - - Raised when a pinch gesture is started. - - \sa pinchUpdated, pinchFinished -*/ - -/*! - \qmlsignal QtLocation5::MapPinchArea::pinchUpdated(PinchEvent event) - - Once a pinch has begun this event gets raised as the user moves her fingers - across the map. - - \sa pinchStarted, pinchFinished -*/ - -/*! - \qmlsignal QtLocation5::MapPinchArea::pinchFinished(PinchEvent event) - - The end of a pinch gesture is signaled by this event. - - \sa pinchStarted, pinchUpdated -*/ - -/*! - \qmlproperty bool QtLocation5::MapPinchArea::enabled - - This property holds whether the pinch gestures are enabled. - - \note disabling pinch during active pinch does not have effect on - the potentially active current pinch. -*/ - -QDeclarativeGeoMapPinchArea::QDeclarativeGeoMapPinchArea(QObject *parent, - QDeclarativeGeoMapGestureArea *gestureArea) - : QObject(parent), - gestureArea_(gestureArea) -{ - gestureArea_->registerPinchDeprecated(this); -} - -QDeclarativeGeoMapPinchArea::~QDeclarativeGeoMapPinchArea() -{ -} - -#include "moc_qdeclarativegeomappincharea_p.cpp" - -QT_END_NAMESPACE diff --git a/src/imports/location/qdeclarativegeomappincharea_p.h b/src/imports/location/qdeclarativegeomappincharea_p.h deleted file mode 100644 index b5a9acc2..00000000 --- a/src/imports/location/qdeclarativegeomappincharea_p.h +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEGEOMAPPINCHAREA_H -#define QDECLARATIVEGEOMAPPINCHAREA_H - -#include <QtQml/qqml.h> -#include <QTouchEvent> -#include <QObject> -#include <QDebug> -#include <QElapsedTimer> -#include "qgeocoordinate.h" -#include "qdeclarativegeomapgesturearea_p.h" - -QT_BEGIN_NAMESPACE - -class QGraphicsSceneMouseEvent; -class QDeclarativeGeoMap; -class QTouchEvent; -class QGeoMap; -class QPropertyAnimation; - -// Note: this class id being deprecated, please use the gestureArea instead -class QDeclarativeGeoMapPinchArea: public QObject -{ - Q_OBJECT - Q_ENUMS(ActiveGesture) - Q_FLAGS(ActiveGestures) - - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(bool active READ active NOTIFY activeChanged) - Q_PROPERTY(ActiveGestures activeGestures READ activeGestures WRITE setActiveGestures NOTIFY activeGesturesChanged) - Q_PROPERTY(qreal maximumZoomLevelChange READ maximumZoomLevelChange WRITE setMaximumZoomLevelChange NOTIFY maximumZoomLevelChangeChanged) - Q_PROPERTY(qreal rotationFactor READ rotationFactor WRITE setRotationFactor NOTIFY rotationFactorChanged) - Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged) - -public: - QDeclarativeGeoMapPinchArea(QObject *parent, QDeclarativeGeoMapGestureArea *gestureArea); - ~QDeclarativeGeoMapPinchArea(); - - enum ActiveGesture { - NoGesture = 0x0000, - ZoomGesture = 0x0001, - RotationGesture = 0x0002, - TiltGesture = 0x0004 - }; - Q_DECLARE_FLAGS(ActiveGestures, ActiveGesture) - ActiveGestures activeGestures() - { - QDeclarativeGeoMapGestureArea::ActiveGestures gestures = gestureArea_->activeGestures(); - activeGestures_ &= 0; // reset; - if (gestures & QDeclarativeGeoMapGestureArea::ZoomGesture) - activeGestures_ |= ZoomGesture; - if (gestures & QDeclarativeGeoMapGestureArea::RotationGesture) - activeGestures_ |= RotationGesture; - if (gestures & QDeclarativeGeoMapGestureArea::TiltGesture) - activeGestures_ |= TiltGesture; - return activeGestures_; - } - void setActiveGestures(ActiveGestures activeGestures) - { - if (activeGestures == activeGestures_) - return; - activeGestures_ = activeGestures; - QDeclarativeGeoMapGestureArea::ActiveGestures &gestures = gestureArea_->activeGestures_; - gestures &= ~7; // reset the pinch component; - if (activeGestures & ZoomGesture) - gestures |= QDeclarativeGeoMapGestureArea::ZoomGesture; - if (activeGestures & RotationGesture) - gestures |= QDeclarativeGeoMapGestureArea::RotationGesture; - if (activeGestures & TiltGesture) - gestures |= QDeclarativeGeoMapGestureArea::TiltGesture; - emit gestureArea_->activeGesturesChanged(); - emit activeGesturesChanged(); - } - - bool active() const { return gestureArea_->isPinchActive(); } - void setActive(bool active) { gestureArea_->setPinchActive(active); } - - bool enabled() const { return gestureArea_->pinchEnabled(); } - void setEnabled(bool enabled){ gestureArea_->setPinchEnabled(enabled); } - - qreal maximumZoomLevelChange() const { return gestureArea_->maximumZoomLevelChange(); } - void setMaximumZoomLevelChange(qreal maxChange){ gestureArea_->setMaximumZoomLevelChange(maxChange); } - - qreal rotationFactor() const { return gestureArea_->rotationFactor(); } - void setRotationFactor(qreal factor){ gestureArea_->setRotationFactor(factor); } - - qreal flickDeceleration() const { return gestureArea_->flickDeceleration(); } - void setFlickDeceleration(qreal deceleration){ gestureArea_->setFlickDeceleration(deceleration); } - - void zoomLevelLimits(qreal min, qreal max){ gestureArea_->zoomLevelLimits(min, max); } - void setMap(QGeoMap *map){ gestureArea_->setMap(map); } - -Q_SIGNALS: - void activeChanged(); - void enabledChanged(); - void maximumZoomLevelChangeChanged(); - void rotationFactorChanged(); - void activeGesturesChanged(); - void flickDecelerationChanged(); - - void pinchStarted(QDeclarativeGeoMapPinchEvent *pinch); - void pinchUpdated(QDeclarativeGeoMapPinchEvent *pinch); - void pinchFinished(QDeclarativeGeoMapPinchEvent *pinch); - -private: - QDeclarativeGeoMapGestureArea *gestureArea_; // the destination for this wrapper class - ActiveGestures activeGestures_; -}; - -QT_END_NAMESPACE -QML_DECLARE_TYPE(QDeclarativeGeoMapPinchArea); - -#endif |