<?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: Bug / Crash: Calling GeoView setAttributionTextVisible does not work and causes crash in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1626867#M5473</link>
    <description>&lt;P&gt;Hello imbachb,&lt;/P&gt;&lt;P&gt;Thank you to report this. I was able to reproduce the problem. This is caused by an invalid QSGNode in MapQuickView. We will fix that.&lt;/P&gt;&lt;P&gt;A possible workaround is to clean up manually the nodes used to render the attribution text. For that, create a new class that derives from MapQuickView and override updatePaintNode functions to remove the children nodes of the root node.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;class MyView : public MapQuickView {
  Q_OBJECT
public:
  QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) {
    // the QSGNode used to render the map
    auto* mapViewNode = MapQuickView::updatePaintNode(node, data);

    // clean up children nodes if the attribution text is not visible
    if (mapViewNode &amp;amp;&amp;amp; !attributionTextVisible()) {
      auto* child = mapViewNode-&amp;gt;firstChild();
      while (child) {
        mapViewNode-&amp;gt;removeChildNode(child);
        delete child;
        child = node-&amp;gt;firstChild();
      }
    }

    return mapViewNode;
  }
};&lt;/LI-CODE&gt;&lt;P&gt;Let me know if this works for you.&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jun 2025 19:25:38 GMT</pubDate>
    <dc:creator>GuillaumeBelz</dc:creator>
    <dc:date>2025-06-25T19:25:38Z</dc:date>
    <item>
      <title>Bug / Crash: Calling GeoView setAttributionTextVisible does not work and causes crash</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1625282#M5471</link>
      <description>&lt;P&gt;We're having issues with setting the attribution text to visible / invisible.&lt;/P&gt;&lt;P&gt;We're using ArcGIS_Maps_SDK_Qt_Windows_200_7_0, with Qt 6.8.1&lt;/P&gt;&lt;P&gt;In our map model we have a simple Q_INVOKABLE function&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void
DisplayMap::toggleAttribution()
{
	m_attribution = !m_attribution;
	m_mapView-&amp;gt;setAttributionTextVisible(m_attribution);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Which gets triggered from QML via a Button&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Button {
    text: "Attribution"
    onClicked: model.toggleAttribution()
}&lt;/LI-CODE&gt;&lt;P&gt;For one, this does&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; hide the Attribution, it seems to not work at all. Then when clicking it multiple times (basically after "hiding" the attribution, showing it again, and then "hiding" it again) it crashes.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="imbachb_0-1750413564698.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/134706iD936DCF5ADAC2ED0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="imbachb_0-1750413564698.png" alt="imbachb_0-1750413564698.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="imbachb_1-1750413649457.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/134707i87EC3241C6C5E62E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="imbachb_1-1750413649457.png" alt="imbachb_1-1750413649457.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Interestingly enough if we hide the attribution "early", i.e. when the model gets a reference to the map view, hiding the attribution works. Still, enabling it later, disabling, enabling again still causes crashes.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void
DisplayMap::setMapView(MapQuickView* mapView)
{
	if (!mapView || mapView == m_mapView)
		return;

	m_mapView = mapView;
	m_mapView-&amp;gt;setMap(m_map);

	m_mapView-&amp;gt;setAttributionTextVisible(false); // This works ...

	emit mapViewChanged();
}&lt;/LI-CODE&gt;&lt;P&gt;Seems like once the map is fully constructed there is no way to change the attribution, and trying so causes the application to crash.&lt;/P&gt;&lt;P&gt;Please find attached a minimalistic example.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 10:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1625282#M5471</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2025-06-20T10:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bug / Crash: Calling GeoView setAttributionTextVisible does not work and causes crash</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1626867#M5473</link>
      <description>&lt;P&gt;Hello imbachb,&lt;/P&gt;&lt;P&gt;Thank you to report this. I was able to reproduce the problem. This is caused by an invalid QSGNode in MapQuickView. We will fix that.&lt;/P&gt;&lt;P&gt;A possible workaround is to clean up manually the nodes used to render the attribution text. For that, create a new class that derives from MapQuickView and override updatePaintNode functions to remove the children nodes of the root node.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;class MyView : public MapQuickView {
  Q_OBJECT
public:
  QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) {
    // the QSGNode used to render the map
    auto* mapViewNode = MapQuickView::updatePaintNode(node, data);

    // clean up children nodes if the attribution text is not visible
    if (mapViewNode &amp;amp;&amp;amp; !attributionTextVisible()) {
      auto* child = mapViewNode-&amp;gt;firstChild();
      while (child) {
        mapViewNode-&amp;gt;removeChildNode(child);
        delete child;
        child = node-&amp;gt;firstChild();
      }
    }

    return mapViewNode;
  }
};&lt;/LI-CODE&gt;&lt;P&gt;Let me know if this works for you.&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 19:25:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1626867#M5473</guid>
      <dc:creator>GuillaumeBelz</dc:creator>
      <dc:date>2025-06-25T19:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Bug / Crash: Calling GeoView setAttributionTextVisible does not work and causes crash</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1631035#M5483</link>
      <description>&lt;P&gt;Instead of using setAttributionTextVisible of&amp;nbsp;GeoView&lt;SPAN&gt;&amp;nbsp;we use your workaround which seems to work. Looking forward to the fix so we can remove this workaround sometime in the future.&lt;BR /&gt;Many thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 09:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/bug-crash-calling-geoview/m-p/1631035#M5483</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2025-07-08T09:15:30Z</dc:date>
    </item>
  </channel>
</rss>

