diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-03-04 00:04:09 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-03-20 14:17:45 +0000 |
commit | e269b3878c71c87ea1b10fe65f69d830929b496d (patch) | |
tree | 52940dc15593f14c019374183deac67513d327f5 /src/imports | |
parent | b35e560ee5bf6d2e3e06bc5b3fa5a78ee2601598 (diff) | |
download | qtlocation-e269b3878c71c87ea1b10fe65f69d830929b496d.tar.gz |
Cleanup event handling function names in qdeclarativegeomap
Change-Id: Ia573741f19eab473d6978849ac9a9616d16a6726
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/location/qdeclarativegeomap.cpp | 22 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomapgesturearea.cpp | 20 | ||||
-rw-r--r-- | src/imports/location/qdeclarativegeomapgesturearea_p.h | 14 |
3 files changed, 24 insertions, 32 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index 23e0faaa..1370e4a9 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -324,7 +324,7 @@ void QDeclarativeGeoMap::componentComplete() */ void QDeclarativeGeoMap::mousePressEvent(QMouseEvent *event) { - event->setAccepted(gestureArea_->mousePressEvent(event)); + event->setAccepted(gestureArea_->handleMousePressEvent(event)); } /*! @@ -332,7 +332,7 @@ void QDeclarativeGeoMap::mousePressEvent(QMouseEvent *event) */ void QDeclarativeGeoMap::mouseMoveEvent(QMouseEvent *event) { - event->setAccepted(gestureArea_->mouseMoveEvent(event)); + event->setAccepted(gestureArea_->handleMouseMoveEvent(event)); } /*! @@ -340,7 +340,7 @@ void QDeclarativeGeoMap::mouseMoveEvent(QMouseEvent *event) */ void QDeclarativeGeoMap::mouseReleaseEvent(QMouseEvent *event) { - event->setAccepted(gestureArea_->mouseReleaseEvent(event)); + event->setAccepted(gestureArea_->handleMouseReleaseEvent(event)); } /*! @@ -348,7 +348,7 @@ void QDeclarativeGeoMap::mouseReleaseEvent(QMouseEvent *event) */ void QDeclarativeGeoMap::mouseUngrabEvent() { - gestureArea_->mouseUngrabEvent(); + gestureArea_->handleMouseUngrabEvent(); } /*! @@ -820,12 +820,7 @@ QGeoServiceProvider::Error QDeclarativeGeoMap::error() const */ void QDeclarativeGeoMap::touchEvent(QTouchEvent *event) { - if (!mappingManagerInitialized_) { - event->ignore(); - return; - } - QLOC_TRACE0; - event->setAccepted(gestureArea_->touchEvent(event)); + event->setAccepted(gestureArea_->handleTouchEvent(event)); } /*! @@ -833,9 +828,8 @@ void QDeclarativeGeoMap::touchEvent(QTouchEvent *event) */ void QDeclarativeGeoMap::wheelEvent(QWheelEvent *event) { - QLOC_TRACE0; - event->accept(); - gestureArea_->wheelEvent(event); + event->setAccepted(gestureArea_->handleWheelEvent(event)); + //TODO: wheelAngleChanged wtf ? emit wheelAngleChanged(event->angleDelta()); } @@ -891,7 +885,7 @@ bool QDeclarativeGeoMap::childMouseEventFilter(QQuickItem *item, QEvent *event) return false; return gestureArea_->filterMapChildTouchEvent(static_cast<QTouchEvent *>(event)); case QEvent::Wheel: - return gestureArea_->wheelEvent(static_cast<QWheelEvent *>(event)); + return gestureArea_->handleWheelEvent(static_cast<QWheelEvent *>(event)); default: return false; } diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp index ac6dadb6..b3251249 100644 --- a/src/imports/location/qdeclarativegeomapgesturearea.cpp +++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp @@ -567,7 +567,7 @@ QTouchEvent::TouchPoint makeTouchPointFromMouseEvent(QMouseEvent *event, Qt::Tou /*! \internal */ -bool QDeclarativeGeoMapGestureArea::mousePressEvent(QMouseEvent *event) +bool QDeclarativeGeoMapGestureArea::handleMousePressEvent(QMouseEvent *event) { if (!(enabled_ && activeGestures_)) return false; @@ -587,7 +587,7 @@ bool QDeclarativeGeoMapGestureArea::mousePressEvent(QMouseEvent *event) /*! \internal */ -bool QDeclarativeGeoMapGestureArea::mouseMoveEvent(QMouseEvent *event) +bool QDeclarativeGeoMapGestureArea::handleMouseMoveEvent(QMouseEvent *event) { if (!(enabled_ && activeGestures_)) return false; @@ -605,7 +605,7 @@ bool QDeclarativeGeoMapGestureArea::mouseMoveEvent(QMouseEvent *event) /*! \internal */ -bool QDeclarativeGeoMapGestureArea::mouseReleaseEvent(QMouseEvent *) +bool QDeclarativeGeoMapGestureArea::handleMouseReleaseEvent(QMouseEvent *) { if (!(enabled_ && activeGestures_)) return false; @@ -624,7 +624,7 @@ bool QDeclarativeGeoMapGestureArea::mouseReleaseEvent(QMouseEvent *) /*! \internal */ -void QDeclarativeGeoMapGestureArea::mouseUngrabEvent() +void QDeclarativeGeoMapGestureArea::handleMouseUngrabEvent() { touchPoints_.clear(); hasGrab_ = false; @@ -636,7 +636,7 @@ void QDeclarativeGeoMapGestureArea::mouseUngrabEvent() /*! \internal */ -bool QDeclarativeGeoMapGestureArea::touchEvent(QTouchEvent *event) +bool QDeclarativeGeoMapGestureArea::handleTouchEvent(QTouchEvent *event) { if (!(enabled_ && activeGestures_)) return false; @@ -685,7 +685,7 @@ bool QDeclarativeGeoMapGestureArea::touchEvent(QTouchEvent *event) return true; } -bool QDeclarativeGeoMapGestureArea::wheelEvent(QWheelEvent *event) +bool QDeclarativeGeoMapGestureArea::handleWheelEvent(QWheelEvent *event) { declarativeMap_->setZoomLevel(qBound(minimumZoomLevel(), declarativeMap_->zoomLevel() + event->angleDelta().y() * qreal(0.001), maximumZoomLevel())); return true; @@ -703,13 +703,13 @@ bool QDeclarativeGeoMapGestureArea::filterMapChildMouseEvent(QMouseEvent *event) // (until we grab it). switch (event->type()) { case QEvent::MouseButtonPress: - mousePressEvent(event); + handleMousePressEvent(event); break; case QEvent::MouseButtonRelease: - mouseReleaseEvent(event); + handleMouseReleaseEvent(event); break; case QEvent::MouseMove: - mouseMoveEvent(event); + handleMouseMoveEvent(event); break; default: break; @@ -727,7 +727,7 @@ bool QDeclarativeGeoMapGestureArea::filterMapChildTouchEvent(QTouchEvent *event) // We have not grabbed the touch id associated with this touch event yet. Process it but don't // filter it so the child can use it (until we grab it). - touchEvent(event); + handleTouchEvent(event); return false; } diff --git a/src/imports/location/qdeclarativegeomapgesturearea_p.h b/src/imports/location/qdeclarativegeomapgesturearea_p.h index 537e9d72..e8347e01 100644 --- a/src/imports/location/qdeclarativegeomapgesturearea_p.h +++ b/src/imports/location/qdeclarativegeomapgesturearea_p.h @@ -149,14 +149,12 @@ public: qreal flickDeceleration() const; void setFlickDeceleration(qreal deceleration); - bool touchEvent(QTouchEvent *event); - - bool wheelEvent(QWheelEvent *event); - - bool mousePressEvent(QMouseEvent *event); - bool mouseMoveEvent(QMouseEvent *event); - bool mouseReleaseEvent(QMouseEvent *event); - void mouseUngrabEvent(); + bool handleTouchEvent(QTouchEvent *event); + bool handleWheelEvent(QWheelEvent *event); + bool handleMousePressEvent(QMouseEvent *event); + bool handleMouseMoveEvent(QMouseEvent *event); + bool handleMouseReleaseEvent(QMouseEvent *event); + void handleMouseUngrabEvent(); bool filterMapChildMouseEvent(QMouseEvent *event); bool filterMapChildTouchEvent(QTouchEvent *event); |