*
* Does emit locationChanged signal.
* @param coordinate Scene coordinates for new position
+ * @param isUserDragAction True if caused by user dragging action
*/
void setCenterPosition(SceneCoordinate coordinate, bool isUserDragAction = false);
* @brief Request view centering to new locaiton
*
* @param coordinate New scene coordinates
+ * @param isUserDragAction True if caused by user dragging action
*/
void locationChanged(SceneCoordinate coordinate, bool isUserDragAction);
/**
* @brief Slot for centering view to new location
*
+ * Does also shift the center point horizontally, if required.
+ *
* @param coordinate Scene coordinates of the new center point
+ * @param isUserDragAction True if caused by user dragging action. Does not shift the center
+ * point if true.
*/
void centerToSceneCoordinates(const SceneCoordinate &coordinate, bool isUserDragAction = false);
void setZoomLevel(int zoomLevel);
private slots:
+ /**
+ * @brief Disables shifting of the center point
+ */
void disableCenterShift();
/**
*/
void doubleTapZoomFinished();
+ /**
+ * @brief Enables shifting of the center point
+ */
void enableCenterShift();
private:
*/
void setViewScale(qreal viewScale);
+ /**
+ * @brief Toggles the shifting of the center point
+ *
+ * @param enabled True if shifting is enabled
+ */
void toggleCenterShift(bool enabled);
+ /**
+ * @brief Update center shifting value
+ */
void updateCenterShift();
/**
*
* Signal is emitted when view is scrolled.
* @param coordinate Scene coordinates of the new center point of the view
+ * @param isUserDragAction True if caused by user dragging action
*/
void viewScrolled(const SceneCoordinate &coordinate, bool isUserDragAction);
* DATA MEMBERS
******************************************************************************/
private:
- bool m_centerShiftEnabled;
- bool m_doubleTapZoomRunning; ///< Double tap zoom running flag
+ bool m_centerShiftEnabled; ///< Is the center point shifting enabled?
+ bool m_doubleTapZoomRunning; ///< Double tap zoom running flag
int m_dragTime[VALUES]; ///< Table of mouse event durations
int m_index; ///< Index of mouse event values tables
QPoint m_lastMouseEventScenePosition; ///< Previous mouse event position in the scene
QPoint m_lastMouseEventViewPosition; ///< Previous mouse event position in the view
- QPointF m_centerHorizontalShift;
+ QPointF m_centerHorizontalShift; ///< Current amount of center point shifting
QParallelAnimationGroup *m_scrollAndZoomAnimation; ///< Double click zoom animation
QPropertyAnimation *m_zoomAnimation; ///< Zoom animation
QTime m_time; ///< Elapsed times in mouse events
- MapScroller *m_scroller; ///< Kinetic scroller
- SceneCoordinate m_lastSetScenePosition;
+ MapScroller *m_scroller; ///< Kinetic scroller
+ SceneCoordinate m_lastSetScenePosition; ///< Last center point coordinate set by MapEngine
};
#endif // MAPVIEW_H
* @brief View should be centered to new location
*
* @param coordinate Scene coordinates of the new center point
+ * @param isUserDragAction True if caused by user dragging action
*/
void centerToSceneCoordinates(const SceneCoordinate &coordinate, bool isUserDragAction);
/**
* @brief Forwarding signal from MapView to MapEngine
*
- * @param coordinate
+ * @param coordinate New center point coordinate
+ * @param isUserDragAction True if caused by user dragging action
*/
void mapViewScrolled(const SceneCoordinate &coordinate, bool isUserDragAction);