<?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: mapGraphicsView mouseMove event only works on click and drag instead of just hover?? in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1474653#M5220</link>
    <description>&lt;P&gt;Hi SWE, thanks for reaching out.&lt;/P&gt;&lt;P&gt;It looks like there may be a regression in the `MouseTracking` property of the QWidget class between Qt 5 and Qt 6 that we're going to look into.&lt;/P&gt;&lt;P&gt;In the meantime, as of ArcGIS Maps SDK for Qt version 200.2, we have a &lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#hoverMoved" target="_self"&gt;MapGraphicsView::hoverMoved&lt;/A&gt;&amp;nbsp;method that should be what you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;connect(m_mapView, &amp;amp;MapGraphicsView::mouseMoved, this, [](QMouseEvent &amp;amp;mouseEvent)
{
  qDebug() &amp;lt;&amp;lt; "button pressed:" &amp;lt;&amp;lt; mouseEvent.position().x() &amp;lt;&amp;lt; mouseEvent.position().y();
});

// This is required for the hoverMoved signal to emit
m_mapView-&amp;gt;setMouseTracking(true);

connect(m_mapView, &amp;amp;MapGraphicsView::hoverMoved, this, [this](QHoverEvent &amp;amp;hoverEvent)
{
  qDebug() &amp;lt;&amp;lt; "hovering:" &amp;lt;&amp;lt; hoverEvent.position().x() &amp;lt;&amp;lt; hoverEvent.position().y();
  
  // convert screen location to map 
  const auto p = m_mapView-&amp;gt;screenToLocation(hoverEvent.position().x(), hoverEvent.position().y());
  qDebug() &amp;lt;&amp;lt; "map coordinates:" &amp;lt;&amp;lt; p.x() &amp;lt;&amp;lt; p.y();
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this works, and thanks again for bringing this to our attention!&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 16:51:34 GMT</pubDate>
    <dc:creator>Tanner_Yould</dc:creator>
    <dc:date>2024-05-17T16:51:34Z</dc:date>
    <item>
      <title>mapGraphicsView mouseMove event only works on click and drag instead of just hover??</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1474428#M5219</link>
      <description>&lt;P&gt;I am looking for a workaround to display coordinates in a label on my widget whenever mouse hovers on "mapGraphicsView" but it only works when i click and drag it besides it doesn't work, is there any way to do it by just hovering over the map and get coordinates as i am using geometry editor to draw a ployline and i need coordinates to always display when i draw a point on map.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;m_mapView-&amp;gt;setMouseTracking(true);&lt;/P&gt;&lt;P&gt;connect(m_mapView, &amp;amp;MapGraphicsView::mouseMoved, this, [](QMouseEvent &amp;amp;mouseEvent)&lt;BR /&gt;{&lt;BR /&gt;qDebug() &amp;lt;&amp;lt; mouseEvent.pos().x() &amp;lt;&amp;lt; mouseEvent.pos().y();&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;or any overriden event like this&amp;nbsp;&lt;BR /&gt;void&amp;nbsp;mouseMoveEvent(QMouseEvent *event);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 09:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1474428#M5219</guid>
      <dc:creator>SWE</dc:creator>
      <dc:date>2024-05-17T09:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: mapGraphicsView mouseMove event only works on click and drag instead of just hover??</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1474653#M5220</link>
      <description>&lt;P&gt;Hi SWE, thanks for reaching out.&lt;/P&gt;&lt;P&gt;It looks like there may be a regression in the `MouseTracking` property of the QWidget class between Qt 5 and Qt 6 that we're going to look into.&lt;/P&gt;&lt;P&gt;In the meantime, as of ArcGIS Maps SDK for Qt version 200.2, we have a &lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#hoverMoved" target="_self"&gt;MapGraphicsView::hoverMoved&lt;/A&gt;&amp;nbsp;method that should be what you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;connect(m_mapView, &amp;amp;MapGraphicsView::mouseMoved, this, [](QMouseEvent &amp;amp;mouseEvent)
{
  qDebug() &amp;lt;&amp;lt; "button pressed:" &amp;lt;&amp;lt; mouseEvent.position().x() &amp;lt;&amp;lt; mouseEvent.position().y();
});

// This is required for the hoverMoved signal to emit
m_mapView-&amp;gt;setMouseTracking(true);

connect(m_mapView, &amp;amp;MapGraphicsView::hoverMoved, this, [this](QHoverEvent &amp;amp;hoverEvent)
{
  qDebug() &amp;lt;&amp;lt; "hovering:" &amp;lt;&amp;lt; hoverEvent.position().x() &amp;lt;&amp;lt; hoverEvent.position().y();
  
  // convert screen location to map 
  const auto p = m_mapView-&amp;gt;screenToLocation(hoverEvent.position().x(), hoverEvent.position().y());
  qDebug() &amp;lt;&amp;lt; "map coordinates:" &amp;lt;&amp;lt; p.x() &amp;lt;&amp;lt; p.y();
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this works, and thanks again for bringing this to our attention!&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 16:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1474653#M5220</guid>
      <dc:creator>Tanner_Yould</dc:creator>
      <dc:date>2024-05-17T16:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: mapGraphicsView mouseMove event only works on click and drag instead of just hover??</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1475215#M5221</link>
      <description>&lt;P&gt;Hey tanner,&lt;BR /&gt;That works and thanks for answering my query and i hope "mouseMove" function to be working on its intended purpose&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 05:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/mapgraphicsview-mousemove-event-only-works-on/m-p/1475215#M5221</guid>
      <dc:creator>SWE</dc:creator>
      <dc:date>2024-05-20T05:19:01Z</dc:date>
    </item>
  </channel>
</rss>

