<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Overriding MapView methods in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/overriding-mapview-methods/m-p/301556#M1489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicholas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To change&amp;nbsp;the behaviour of double-click you could derive your own view type from MapQuickView (or MapGraphicsView) and override this protected method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808000;"&gt;virtual void&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;mouseDoubleClickEvent&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;QMouseEvent&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;*event);&lt;/PRE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should make sure that your implementation still calls through to the event on the base QuickItem like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #800080;"&gt;QQuickItem&lt;/SPAN&gt;::&lt;SPAN style="color: #000000;"&gt;mouseDoubleClickEvent&lt;/SPAN&gt;(event);

&lt;/PRE&gt;&lt;P&gt;and then depending on what you want to happen you may want to accept or ignore the event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;A class="link-titled" href="https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-mapview.html#details" title="https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-mapview.html#details" rel="nofollow noopener noreferrer" target="_blank"&gt;MapView Class | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully that is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:18:59 GMT</pubDate>
    <dc:creator>LukeSmallwood</dc:creator>
    <dc:date>2021-12-12T16:18:59Z</dc:date>
    <item>
      <title>Overriding MapView methods</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/overriding-mapview-methods/m-p/301555#M1488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I go about extending this class and overriding those methods?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2017 13:43:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/overriding-mapview-methods/m-p/301555#M1488</guid>
      <dc:creator>NicholasLiccini</dc:creator>
      <dc:date>2017-09-01T13:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Overriding MapView methods</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/overriding-mapview-methods/m-p/301556#M1489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicholas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To change&amp;nbsp;the behaviour of double-click you could derive your own view type from MapQuickView (or MapGraphicsView) and override this protected method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808000;"&gt;virtual void&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;mouseDoubleClickEvent&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;QMouseEvent&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;*event);&lt;/PRE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should make sure that your implementation still calls through to the event on the base QuickItem like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #800080;"&gt;QQuickItem&lt;/SPAN&gt;::&lt;SPAN style="color: #000000;"&gt;mouseDoubleClickEvent&lt;/SPAN&gt;(event);

&lt;/PRE&gt;&lt;P&gt;and then depending on what you want to happen you may want to accept or ignore the event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;A class="link-titled" href="https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-mapview.html#details" title="https://developers.arcgis.com/qt/latest/cpp/api-reference/esri-arcgisruntime-mapview.html#details" rel="nofollow noopener noreferrer" target="_blank"&gt;MapView Class | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully that is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:18:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/overriding-mapview-methods/m-p/301556#M1489</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2021-12-12T16:18:59Z</dc:date>
    </item>
  </channel>
</rss>

