<?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[Display data from two SQL Tables with QTreeView]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am trying to create a model based on QAbstractItemModel to be used with QTreeView in order to display data contained in two SQL tables. The first table, Table1, has the rowId as primary key. The second table, Table2, has also a primary key and another field as foreign key which references Table1(rowId).<br />
As far as I understand, QAbstractItemModel::index returns an QModelIndex into which I embed data (internalPointer()) which I later use when QAbstractItemModel::data and QAbstractItemModel::parent are called.<br />
The problem is that the dataset is huge hence I cannot cache it and I would like to cache only the rows that are visible. Is there any way to know which rows are visible ?<br />
How would you approach this problem?</p>
<p dir="auto">Best regards,<br />
Nicolae Rosia.</p>
]]></description><link>https://forum.qt.io/topic/31046/display-data-from-two-sql-tables-with-qtreeview</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 08:30:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/31046.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Aug 2013 16:36:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Display data from two SQL Tables with QTreeView on Sat, 24 Aug 2013 03:51:01 GMT]]></title><description><![CDATA[<p dir="auto">Use two QSqlTableModels inside your custom QAbstractItemModel, and I don't think you need worry about cacheing the rows yourself, it will be taken care by QSqlTableModels</p>
]]></description><link>https://forum.qt.io/post/192352</link><guid isPermaLink="true">https://forum.qt.io/post/192352</guid><dc:creator><![CDATA[Santosh Reddy]]></dc:creator><pubDate>Sat, 24 Aug 2013 03:51:01 GMT</pubDate></item></channel></rss>