<?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: Why does MapGraphicsView not have a signal for mouse hover move? in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1166431#M4521</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/329243"&gt;@TroyFoster&lt;/a&gt;. Let's try to get you a solution that doesn't involve remapping mouse buttons.&lt;/P&gt;&lt;P&gt;If I follow, what you're looking for is a way to differentiate between a "drag" (mouse is moving, while one or more buttons are pressed), and a "hover", meaning the mouse is moving over the map but not interacting (no buttons pressed).&lt;/P&gt;&lt;P&gt;You should be able to do this already with the mouseMoved event. You can check the QMouseEvent object and determine if any mouse buttons were pressed at the time of the move.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.qt.io/qt-5/qmouseevent.html#buttons" target="_blank"&gt;https://doc.qt.io/qt-5/qmouseevent.html#buttons&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#mouseMoved" target="_blank"&gt;https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#mouseMoved&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do you think that will work for your case?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2022 22:03:54 GMT</pubDate>
    <dc:creator>JamesBallard1</dc:creator>
    <dc:date>2022-04-20T22:03:54Z</dc:date>
    <item>
      <title>Why does MapGraphicsView not have a signal for mouse hover move?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1165622#M4518</link>
      <description>&lt;P&gt;From looking at the runtime Java's API their mouse moved signal is a hover move and mouse dragged is for when the user click and dragged the mouse on the map.&amp;nbsp; Why doesn't the runtime Qt have the same sort of setup for connecting to a signal for hover move events?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a workaround by creating a class inheriting&amp;nbsp;QGraphicsItem and calling&amp;nbsp;setAcceptHoverEvents on it.&amp;nbsp; However I have reports from our users that sometimes the QGraphicsItem class sometimes stops receiving any mouse events at all until the window is resized.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 13:23:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1165622#M4518</guid>
      <dc:creator>TroyFoster</dc:creator>
      <dc:date>2022-04-19T13:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why does MapGraphicsView not have a signal for mouse hover move?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1165808#M4519</link>
      <description>&lt;P&gt;Hi Troy, I hope I can help here. You can enable (or disable) mouse tracking on a `&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html" target="_self"&gt;MapGraphicsView&lt;/A&gt;` when hovering with `&lt;A href="https://doc.qt.io/qt-5/qwidget.html#mouseTracking-prop" target="_self"&gt;setMouseTracking(bool &lt;EM&gt;enable&lt;/EM&gt;)&lt;/A&gt;&amp;nbsp;`, which it inherits from `&lt;A href="https://doc.qt.io/qt-5/qwidget.html" target="_self"&gt;QWidget&lt;/A&gt;`. To help test a solution, I added the following code block to our&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_CppSamples_Widgets/Maps/DisplayMap" target="_self"&gt;Display Map C++ Widget sample&lt;/A&gt;&amp;nbsp;and the `&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#mouseMoved" target="_self"&gt;mouseMoved&lt;/A&gt;` signal emits when I move my mouse around the map while hovering and prints the mouse's current xy position.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;m_mapView-&amp;gt;setMouseTracking(true);

connect(m_mapView, &amp;amp;MapGraphicsView::mouseMoved, this, [](QMouseEvent mouseEvent)
{
  qDebug() &amp;lt;&amp;lt; mouseEvent.x() &amp;lt;&amp;lt; mouseEvent.y();
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps and please let me know if there's anything else I can do.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 18:50:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1165808#M4519</guid>
      <dc:creator>Tanner_Yould</dc:creator>
      <dc:date>2022-04-19T18:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why does MapGraphicsView not have a signal for mouse hover move?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1166046#M4520</link>
      <description>&lt;P&gt;That seems like it works but it breaks another workaround we have.&amp;nbsp; We used the&amp;nbsp;&lt;SPAN&gt;QGraphicsItem's mouse moved signal and if it was a left click and drag would use that to query the items drawn on the map, and if it was a middle mouse click and drag we would take the event and change the button and pass that on to QGraphicsItem::mouseMoveEvent so the runtime Qt would see it as a drag operation and pan the map around.&amp;nbsp; Do you know of a way to re-map those buttons, either as a setting for just the esri software or to do it every time in the mouse moved signal?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 12:03:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1166046#M4520</guid>
      <dc:creator>TroyFoster</dc:creator>
      <dc:date>2022-04-20T12:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why does MapGraphicsView not have a signal for mouse hover move?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1166431#M4521</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/329243"&gt;@TroyFoster&lt;/a&gt;. Let's try to get you a solution that doesn't involve remapping mouse buttons.&lt;/P&gt;&lt;P&gt;If I follow, what you're looking for is a way to differentiate between a "drag" (mouse is moving, while one or more buttons are pressed), and a "hover", meaning the mouse is moving over the map but not interacting (no buttons pressed).&lt;/P&gt;&lt;P&gt;You should be able to do this already with the mouseMoved event. You can check the QMouseEvent object and determine if any mouse buttons were pressed at the time of the move.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.qt.io/qt-5/qmouseevent.html#buttons" target="_blank"&gt;https://doc.qt.io/qt-5/qmouseevent.html#buttons&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#mouseMoved" target="_blank"&gt;https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html#mouseMoved&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do you think that will work for your case?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 22:03:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/why-does-mapgraphicsview-not-have-a-signal-for/m-p/1166431#M4521</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2022-04-20T22:03:54Z</dc:date>
    </item>
  </channel>
</rss>

