<?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: How do I filter LegendInfoListModel in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-do-i-filter-legendinfolistmodel/m-p/281756#M1422</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using C++, the best way to do it would probably be to create a QSortFilterProxyModel. Since you are using QML, I'd suggest 2 different approaches:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. In your delegate, set the visibility of the delegate based on some condition. Like if you don't want your "Trees" layer to show in the legend, then set the following in your delegate&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;visible: layerName !== "Trees"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create a new ListModel object, then, loop through the original list model and only add the ones you want to the new ListModel. Something along these lines should work, but it seems less ideal because you have to maintain 2 versions of the list model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Mar 2019 16:17:00 GMT</pubDate>
    <dc:creator>LucasDanzinger</dc:creator>
    <dc:date>2019-03-20T16:17:00Z</dc:date>
    <item>
      <title>How do I filter LegendInfoListModel</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-do-i-filter-legendinfolistmodel/m-p/281755#M1421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to hide the legend from a couple of layers or edit it slightly, but I am unable to figure out how to view the Model data that is represented on this page (I want to iterate the model and get Name, SymbolURL, LayerName, etc)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-legendinfolistmodel.html#get-method" title="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-legendinfolistmodel.html#get-method"&gt;LegendInfoListModel QML Type | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see how to used the mode using the example&amp;nbsp;here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-samples-qt/blob/37f29d3634a2ee71933836e6546c58d42fcfe081/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/BuildLegend/BuildLegend.qml" title="https://github.com/Esri/arcgis-runtime-samples-qt/blob/37f29d3634a2ee71933836e6546c58d42fcfe081/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/BuildLegend/BuildLegend.qml"&gt;arcgis-runtime-samples-qt/BuildLegend.qml at 37f29d3634a2ee71933836e6546c58d42fcfe081 · Esri/arcgis-runtime-samples-qt ·…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how do I update the legendinfos Model and remove an entry?&amp;nbsp; I don't even know how to view it?&amp;nbsp; I have tried json.stringify and&amp;nbsp;legendinfos.forEach(function(element, index, array), but those just seem to return the colors and other information.&amp;nbsp; I want the information on the legendinfoListMode page so I can remove some layers and elements of that legend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2019 19:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-do-i-filter-legendinfolistmodel/m-p/281755#M1421</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2019-03-15T19:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter LegendInfoListModel</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-do-i-filter-legendinfolistmodel/m-p/281756#M1422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using C++, the best way to do it would probably be to create a QSortFilterProxyModel. Since you are using QML, I'd suggest 2 different approaches:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. In your delegate, set the visibility of the delegate based on some condition. Like if you don't want your "Trees" layer to show in the legend, then set the following in your delegate&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;visible: layerName !== "Trees"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create a new ListModel object, then, loop through the original list model and only add the ones you want to the new ListModel. Something along these lines should work, but it seems less ideal because you have to maintain 2 versions of the list model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2019 16:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-do-i-filter-legendinfolistmodel/m-p/281756#M1422</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2019-03-20T16:17:00Z</dc:date>
    </item>
  </channel>
</rss>

