<?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 Question on getting MouseEvent in QML in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1049929#M4053</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I use Runtime version 100.8 and Qt 5.15.0 .&lt;/P&gt;&lt;P&gt;The code is almost the same, but I can't get MouseEvent.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Connections{
    target: mainMap

    //can't get
    function onMouseClicked() {
        var clickP = mainMap.screenToLocation(mouse.x, mouse.y)
        console.log(mouse.x)
    }

    //can get
    onMouseClicked: {
        var clickP = mainMap.screenToLocation(mouse.x, mouse.y)
        console.log(mouse.x)
    }    
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the side where I can get MouseEvent, I will get the following error.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(&amp;lt;arguments&amp;gt;) { ... }&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I do in this situation?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Apr 2021 02:15:59 GMT</pubDate>
    <dc:creator>Tkm_Knj</dc:creator>
    <dc:date>2021-04-22T02:15:59Z</dc:date>
    <item>
      <title>Question on getting MouseEvent in QML</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1049929#M4053</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I use Runtime version 100.8 and Qt 5.15.0 .&lt;/P&gt;&lt;P&gt;The code is almost the same, but I can't get MouseEvent.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Connections{
    target: mainMap

    //can't get
    function onMouseClicked() {
        var clickP = mainMap.screenToLocation(mouse.x, mouse.y)
        console.log(mouse.x)
    }

    //can get
    onMouseClicked: {
        var clickP = mainMap.screenToLocation(mouse.x, mouse.y)
        console.log(mouse.x)
    }    
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the side where I can get MouseEvent, I will get the following error.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(&amp;lt;arguments&amp;gt;) { ... }&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I do in this situation?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 02:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1049929#M4053</guid>
      <dc:creator>Tkm_Knj</dc:creator>
      <dc:date>2021-04-22T02:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Question on getting MouseEvent in QML</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1049993#M4054</link>
      <description>&lt;P&gt;Hi there.&lt;BR /&gt;&lt;BR /&gt;I'm also a tad confused with the new connection syntax in Qt 5.15, will take some time to get used to.&lt;BR /&gt;Here's a formulation that worked for me, try giving this a go.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;MapView {
    id : mapView
    anchors.fill: parent
    focus: true

    Map {
        // add the ArcGISStreets basemap to the map
        initBasemapStyle: Enums.BasemapStyleArcGISStreets
    }

    Connections {
        target: mapView
        function onMouseClicked(mouseEvent) {
            console.log("x:", mouseEvent.x, "y:", mouseEvent.y)
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 09:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1049993#M4054</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-04-22T09:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Question on getting MouseEvent in QML</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1050431#M4056</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;It code is correct.&lt;/P&gt;&lt;P&gt;I can get&amp;nbsp;&lt;SPAN&gt;MouseEvent.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 23:13:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/question-on-getting-mouseevent-in-qml/m-p/1050431#M4056</guid>
      <dc:creator>Tkm_Knj</dc:creator>
      <dc:date>2021-04-22T23:13:48Z</dc:date>
    </item>
  </channel>
</rss>

