Hi!
I would like to subclass the MapView class (for the C++/QtQuick template) so that mouse events have different results. For example, I don't want double clicking on the map to zoom in.
How would I go about extending this class and overriding those methods?
Nick
Solved! Go to Solution.
Hi Nicholas,
To change the behaviour of double-click you could derive your own view type from MapQuickView (or MapGraphicsView) and override this protected method:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
This would let you simply ignore double-clicks on the view - if you need double-clicks to do something else you may be able to add that here as well.
You should make sure that your implementation still calls through to the event on the base QuickItem like so:
QQuickItem::mouseDoubleClickEvent(event);
and then depending on what you want to happen you may want to accept or ignore the event.
It is also possible to derive your view type from MapView (rather than MapQuickView) but this would require implementing a lot more of the interface - see MapView Class | ArcGIS for Developers .
Hopefully that is helpful.
Luke
Hi Nicholas,
To change the behaviour of double-click you could derive your own view type from MapQuickView (or MapGraphicsView) and override this protected method:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
This would let you simply ignore double-clicks on the view - if you need double-clicks to do something else you may be able to add that here as well.
You should make sure that your implementation still calls through to the event on the base QuickItem like so:
QQuickItem::mouseDoubleClickEvent(event);
and then depending on what you want to happen you may want to accept or ignore the event.
It is also possible to derive your view type from MapView (rather than MapQuickView) but this would require implementing a lot more of the interface - see MapView Class | ArcGIS for Developers .
Hopefully that is helpful.
Luke