<?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 get Parent and granparentIdx in QtreeView]]></title><description><![CDATA[<p dir="auto">I have QtreeView</p>
<p dir="auto">A<br />
|<br />
___B<br />
|<br />
------C</p>
<p dir="auto">I have QModelIndex pointing to C from C QMoldeinx I want to go till A  . and select A  when I have nodeIdx of C</p>
<p dir="auto">if(nodeIdx.isValid())<br />
{<br />
treeView-&gt;setExpanded(nodeIdx, true);<br />
if(setCurrent)<br />
{<br />
treeView-&gt;setCurrentIndex(nodeIdx);<br />
}<br />
}</p>
]]></description><link>https://forum.qt.io/topic/93361/how-to-get-parent-and-granparentidx-in-qtreeview</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 04:52:54 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/93361.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 04 Aug 2018 15:31:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to get Parent and granparentIdx in QtreeView on Sat, 04 Aug 2018 18:48:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">IIRC, you can navigate the tree up by using the parent method up to the index which has no parent anymore.</p>
]]></description><link>https://forum.qt.io/post/473954</link><guid isPermaLink="true">https://forum.qt.io/post/473954</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 04 Aug 2018 18:48:55 GMT</pubDate></item></channel></rss>