<?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[Sync QTreeView selection with QTableView root]]></title><description><![CDATA[<p dir="auto">Hey forum.</p>
<p dir="auto">I'm struggling with this problem. I can't see how to achieve this.<br />
I have my model SoftModel.<br />
I have a QTreeView called SoftView with a Proxy which displays only first column.<br />
And I want a QListView or QTableView (called SoftOptions with a Proxy wich switch rows and columns ) which displays other columns depending on QTreeView first item selection.</p>
<p dir="auto">I noticed basic use of QModelIndex is unusable because it shows index in current item table.<br />
Basically, first item of a node have the same row and column of any other other node first item.</p>
<p dir="auto">So, how to set the root of my QTableView if all QModelIndex are "identical"?<br />
I figured createIndex with index(row, column, &amp;QModelIndex) could be useful, but I really don't get how it works.</p>
<p dir="auto">Thanks for any help.</p>
]]></description><link>https://forum.qt.io/topic/47132/sync-qtreeview-selection-with-qtableview-root</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 17:17:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/47132.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 Oct 2014 12:21:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sync QTreeView selection with QTableView root on Tue, 21 Oct 2014 12:22:10 GMT]]></title><description><![CDATA[<p dir="auto">Hey again Andre.<br />
To extend on my previous post, I'm also wondering if I should/can set the TableView root to a SubNode, or if I should tweak its proxy to display only this SubNode?<br />
I'm a bit lost as you can see.</p>
]]></description><link>https://forum.qt.io/post/248512</link><guid isPermaLink="true">https://forum.qt.io/post/248512</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 21 Oct 2014 12:22:10 GMT</pubDate></item><item><title><![CDATA[Reply to Sync QTreeView selection with QTableView root on Fri, 17 Oct 2014 14:10:07 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Andre. I was thinking of this method too.<br />
First, TreeView &amp; TableView are sharing the same base model.</p>
<p dir="auto">I tried with mapToSource on TreeView's Proxy and mapFromSource on TableView Proxy, but nothing happens. :/</p>
<p dir="auto">I tried also to store each parent to RootNode in a QModelIndexList, from the QModelIndex selected. But I don't know how to apply this back to the TableView.</p>
<p dir="auto">Just to be sure, on the TableView, I do need to use setRootIndex for my goal?</p>
]]></description><link>https://forum.qt.io/post/247988</link><guid isPermaLink="true">https://forum.qt.io/post/247988</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 17 Oct 2014 14:10:07 GMT</pubDate></item><item><title><![CDATA[Reply to Sync QTreeView selection with QTableView root on Fri, 17 Oct 2014 12:38:54 GMT]]></title><description><![CDATA[<p dir="auto">You will need to traverse your proxies in order to translate your current tree view selection to an index that matches the model your table view is presenting.</p>
]]></description><link>https://forum.qt.io/post/247979</link><guid isPermaLink="true">https://forum.qt.io/post/247979</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Fri, 17 Oct 2014 12:38:54 GMT</pubDate></item></channel></rss>