<?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: Trouble detecting mouseClick event in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066694#M4236</link>
    <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;In QtWidgets, the name of event functions are "mouseXxxEvent": &lt;A href="https://doc.qt.io/qt-5/qgraphicsview.html#mousePressEvent" target="_blank" rel="noopener"&gt;https://doc.qt.io/qt-5/qgraphicsview.html#mousePressEvent&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;"mouseClicked" is a signal provided by map and scene views, not an event handler:&amp;nbsp;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can use it like every signals:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Dispay_a_map::Dispay_a_map() 
{
    connect(this, &amp;amp;Dispay_a_map::mouseClicked, 
            this, &amp;amp;Dispay_a_map::handleMouseClicked);
}

// defined as slot
void Display_a_map::handleMouseClicked(QMouseEvent *event)
{
    if (event-&amp;gt;button() == Qt::LeftButton) {
        qDebug() &amp;lt;&amp;lt; "testing";
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jun 2021 22:59:54 GMT</pubDate>
    <dc:creator>GuillaumeBelz</dc:creator>
    <dc:date>2021-06-09T22:59:54Z</dc:date>
    <item>
      <title>Trouble detecting mouseClick event</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066690#M4235</link>
      <description>&lt;P&gt;I'm developing in Qt with C++. I have displayed a map and want to be able to register when the mouse clicks on a location on the map. in my class .cpp file I have tried including the mouseClicked(QMouseEvent *event), but this is never called when I click.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Display_a_map.cpp

void Display_a_map::mouseClicked(QMouseEvent *event) 
{
    if (event-&amp;gt;button() == Qt::LeftButton) {
        qDebug() &amp;lt;&amp;lt; "testing";
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 22:52:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066690#M4235</guid>
      <dc:creator>johnmarker</dc:creator>
      <dc:date>2021-06-09T22:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble detecting mouseClick event</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066694#M4236</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;In QtWidgets, the name of event functions are "mouseXxxEvent": &lt;A href="https://doc.qt.io/qt-5/qgraphicsview.html#mousePressEvent" target="_blank" rel="noopener"&gt;https://doc.qt.io/qt-5/qgraphicsview.html#mousePressEvent&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;"mouseClicked" is a signal provided by map and scene views, not an event handler:&amp;nbsp;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can use it like every signals:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Dispay_a_map::Dispay_a_map() 
{
    connect(this, &amp;amp;Dispay_a_map::mouseClicked, 
            this, &amp;amp;Dispay_a_map::handleMouseClicked);
}

// defined as slot
void Display_a_map::handleMouseClicked(QMouseEvent *event)
{
    if (event-&amp;gt;button() == Qt::LeftButton) {
        qDebug() &amp;lt;&amp;lt; "testing";
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 22:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066694#M4236</guid>
      <dc:creator>GuillaumeBelz</dc:creator>
      <dc:date>2021-06-09T22:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble detecting mouseClick event</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066972#M4239</link>
      <description>&lt;P&gt;Ahhh. That makes a lot of sense. Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 16:33:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/trouble-detecting-mouseclick-event/m-p/1066972#M4239</guid>
      <dc:creator>johnmarker</dc:creator>
      <dc:date>2021-06-10T16:33:24Z</dc:date>
    </item>
  </channel>
</rss>

