<?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: IdentifyLayerCompleted signal is getting called increasingly in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215974#M1079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc, if you know that you want to use the connection just once it would be a good idea to disconnect it afterwards. A simple way to do this is to store the return type of the original connection and then pass this to a call to disconnect (&lt;A class="link-titled" href="http://doc.qt.io/qt-5/qobject.html#disconnect-4" title="http://doc.qt.io/qt-5/qobject.html#disconnect-4"&gt;QObject Class | Qt Core 5.9&lt;/A&gt;&amp;nbsp;) once the work is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is still good practice to make sure that you are not creating multiple copies of the same connection so I would recommend moving those calls to a place where they will only be executed once - e.g. where the layers are first set up.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Aug 2017 09:33:47 GMT</pubDate>
    <dc:creator>LukeSmallwood</dc:creator>
    <dc:date>2017-08-22T09:33:47Z</dc:date>
    <item>
      <title>IdentifyLayerCompleted signal is getting called increasingly</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215971#M1076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I connect the IdentifyLayerCompleted signal with a slot, in which I check the TaskWatcher's taskId() to make sure I have the correct signal.&lt;/P&gt;&lt;P&gt;However, every time I execute the identifyLayer method, the number of time this slot is called increases, using the same taskID for each call.&lt;/P&gt;&lt;P&gt;How can I remove this extra signal calls ?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;void Myclass::mouseClickedSlot(QMouseEvent&amp;amp; mouseEvent)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;connect(_mapView, &amp;amp;MapQuickView::identifyLayerCompleted, this, &amp;amp;Myclass::clickedSlot);
 &amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; _map-&amp;gt;operationalLayers()-&amp;gt;rowCount(); ++i) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeatureLayer* thisLayer = (FeatureLayer*)(_map-&amp;gt;operationalLayers()-&amp;gt;at(i));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TaskWatcher tw = _mapView-&amp;gt;identifyLayer(thisLayer, mouseEvent.x(), mouseEvent.y(), 10, false, 10);
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_identifyTasks.push_back(tw.taskId());
&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}

void Myclass::clickedSlot(QUuid taskID, IdentifyLayerResult* identifyResult)
{
 &amp;nbsp;&amp;nbsp;&amp;nbsp;if (find(_identifyTasks.begin(), _identifyTasks.end(), taskID) == _selectedTasks.end()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// not the taskID I was expecting
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;
 &amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;// do something, depending on the layer&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;// ...
}

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:11:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215971#M1076</guid>
      <dc:creator>MarcWouters</dc:creator>
      <dc:date>2021-12-12T16:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: IdentifyLayerCompleted signal is getting called increasingly</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215972#M1077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this line is the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;connect(_mapView, &amp;amp;MapQuickView::identifyLayerCompleted, this, &amp;amp;Myclass::clickedSlot);

&lt;/PRE&gt;&lt;P&gt;It looks like this is being called every time you receive the QMouseEvent form your mouseClickedSlot - that means you will be getting a new connection each time. If possible you should move the connection to the c'tor of the class (or immediately after the MapQuickView is created - possibly in the component completed method?) so that this only happens once. I think you may also want to clear the _identifyTasks container each time you enter the mouseClickedSlot or this will continue to grow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:34:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215972#M1077</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2021-12-11T10:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: IdentifyLayerCompleted signal is getting called increasingly</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215973#M1078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luke,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What a fast response time !&lt;/P&gt;&lt;P&gt;You are right about creating a new connection every time I click the mouse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then I have a related question : selectFeatures() works on layers, queryFeatures() works on tables.&lt;BR /&gt;Should I also make these connections in the constructor for all the layers and tables I use (which can vary during the lifetime of the application), or is it possible to disconnect every time the slot has done it's work ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 09:26:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215973#M1078</guid>
      <dc:creator>MarcWouters</dc:creator>
      <dc:date>2017-08-22T09:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: IdentifyLayerCompleted signal is getting called increasingly</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215974#M1079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc, if you know that you want to use the connection just once it would be a good idea to disconnect it afterwards. A simple way to do this is to store the return type of the original connection and then pass this to a call to disconnect (&lt;A class="link-titled" href="http://doc.qt.io/qt-5/qobject.html#disconnect-4" title="http://doc.qt.io/qt-5/qobject.html#disconnect-4"&gt;QObject Class | Qt Core 5.9&lt;/A&gt;&amp;nbsp;) once the work is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is still good practice to make sure that you are not creating multiple copies of the same connection so I would recommend moving those calls to a place where they will only be executed once - e.g. where the layers are first set up.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 09:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215974#M1079</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2017-08-22T09:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: IdentifyLayerCompleted signal is getting called increasingly</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215975#M1080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Luke,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish all my programming problems could be fixed so quickly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 10:06:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/identifylayercompleted-signal-is-getting-called/m-p/215975#M1080</guid>
      <dc:creator>MarcWouters</dc:creator>
      <dc:date>2017-08-22T10:06:15Z</dc:date>
    </item>
  </channel>
</rss>

