<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to enable RootIsDecorated in QTreeView if the first column is hidden]]></title><description><![CDATA[<p dir="auto">If I hide the first column in a QTreeView the root decorate disappears even if setRootIsDecorated is set to true.</p>
<pre><code>m_ui-&gt;treeView-&gt;setModel(m_sqlTreeModel);
m_ui-&gt;treeView-&gt;hideColumn(0);
m_ui-&gt;treeView-&gt;setRootIsDecorated(true);
</code></pre>
<p dir="auto">How can I enable the root decorate, when I hide the first column?</p>
]]></description><link>https://forum.qt.io/topic/112779/how-to-enable-rootisdecorated-in-qtreeview-if-the-first-column-is-hidden</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 07:22:35 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/112779.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Mar 2020 17:08:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to enable RootIsDecorated in QTreeView if the first column is hidden on Wed, 22 Dec 2021 11:42:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andreasf">@<bdi>AndreasF</bdi></a><br />
Given the behaviour it apparently has, maybe you could insert a <code>QIdentityProxyModel</code>-derived class between the view and your model to "map" the first visible column to be the first one if that is required?</p>
]]></description><link>https://forum.qt.io/post/695854</link><guid isPermaLink="true">https://forum.qt.io/post/695854</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 22 Dec 2021 11:42:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to enable RootIsDecorated in QTreeView if the first column is hidden on Wed, 22 Dec 2021 11:28:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a><br />
Hello Christian,</p>
<p dir="auto">of course you are right that I am in control of the displayed data and sequence on my own model. However, there are circumstances that would suggest that I have a present structure and for whatever reason I want to hide columns. Therefore I hoped that the QTreeView for the display of the branches can be configured to always display the node (expand/collapse) in the first visible column.</p>
]]></description><link>https://forum.qt.io/post/695852</link><guid isPermaLink="true">https://forum.qt.io/post/695852</guid><dc:creator><![CDATA[AndreasF]]></dc:creator><pubDate>Wed, 22 Dec 2021 11:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to How to enable RootIsDecorated in QTreeView if the first column is hidden on Tue, 21 Dec 2021 16:23:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andreasf">@<bdi>AndreasF</bdi></a> said in <a href="/post/695676">How to enable RootIsDecorated in QTreeView if the first column is hidden</a>:</p>
<blockquote>
<p dir="auto">How do I get the branch drawn when the first column is hidden.</p>
</blockquote>
<p dir="auto">Don't hide the first column - the decoration belongs to the first column. Since you're creating the model I don't see why the first column must be hidden - simply move that data to another column in your model.</p>
]]></description><link>https://forum.qt.io/post/695679</link><guid isPermaLink="true">https://forum.qt.io/post/695679</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 21 Dec 2021 16:23:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to enable RootIsDecorated in QTreeView if the first column is hidden on Tue, 21 Dec 2021 16:19:44 GMT]]></title><description><![CDATA[<p dir="auto">Hallo,<br />
I have the same question and have not come across an answer yet. How do I get the branch drawn when the first column is hidden.</p>
]]></description><link>https://forum.qt.io/post/695676</link><guid isPermaLink="true">https://forum.qt.io/post/695676</guid><dc:creator><![CDATA[AndreasF]]></dc:creator><pubDate>Tue, 21 Dec 2021 16:19:44 GMT</pubDate></item><item><title><![CDATA[Reply to How to enable RootIsDecorated in QTreeView if the first column is hidden on Mon, 23 Mar 2020 15:49:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> I would like have just one column in the tree view and would like to hide the first and the second column of the model and have the root decoration in front of the third column.</p>
]]></description><link>https://forum.qt.io/post/584193</link><guid isPermaLink="true">https://forum.qt.io/post/584193</guid><dc:creator><![CDATA[Infinity]]></dc:creator><pubDate>Mon, 23 Mar 2020 15:49:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to enable RootIsDecorated in QTreeView if the first column is hidden on Sat, 21 Mar 2020 20:02:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Well, technically you are hiding the root index so it's not going to be painted.</p>
<p dir="auto">What exactly are you after ?</p>
]]></description><link>https://forum.qt.io/post/583902</link><guid isPermaLink="true">https://forum.qt.io/post/583902</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 21 Mar 2020 20:02:50 GMT</pubDate></item></channel></rss>