<?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[Complex Data Model]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I have an object named AVehicle that has two arrays - one of parts objects, and another of materials objects.  I need to set up a QListView to display the parts, and a QTableView to display the materials.  AVehicle is a subclass of QAbstractTableModel, and I have the ListView working.  I don't know how to setup the delegate so that it will differentiate between the two Views.</p>
<p dir="auto">How should I handle this?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.qt.io/topic/12259/complex-data-model</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 03:53:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/12259.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Dec 2011 17:46:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Complex Data Model on Mon, 16 Dec 2013 13:28:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello and sorry for bringing up this old thread, but I felt it's better than starting a new one.</p>
<p dir="auto">On several occasions, I ran into problems very similar to jwombie's. I always wondered how to use QAIM correctly. (Side note: unfortunately, Qt's design isn't helpful here: there are Qt models that are adapters ( e.g. QSqlTableModel) and Qt models that are data stores (e.g. QStringListModel))</p>
<p dir="auto">I always tended to create adapter models that provide a view into my data, however that may be stored. But then I quickly ran into problems. I would not be able to tell what models to notify if the underlying data had changed. A google search suggested that I was doing it wrong and I should just use one big QAIM to avoid synchronization problems :-(</p>
<p dir="auto">So my question is: if a QAIM is best used as an adapter, is there any "recommended practice" how to synchronize models?<br />
I'm afraid of using a single, huge QAIM. Trying to squeeze all of my data into a hierarchical table would quickly become ugly (I tried. I gave up).</p>
<p dir="auto">Thanks<br />
Markus</p>
]]></description><link>https://forum.qt.io/post/126497</link><guid isPermaLink="true">https://forum.qt.io/post/126497</guid><dc:creator><![CDATA[mmoll]]></dc:creator><pubDate>Mon, 16 Dec 2013 13:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to Complex Data Model on Thu, 15 Dec 2011 19:54:58 GMT]]></title><description><![CDATA[<p dir="auto">That's where I was going wrong.  Thanks!</p>
]]></description><link>https://forum.qt.io/post/120721</link><guid isPermaLink="true">https://forum.qt.io/post/120721</guid><dc:creator><![CDATA[jwomble]]></dc:creator><pubDate>Thu, 15 Dec 2011 19:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to Complex Data Model on Thu, 15 Dec 2011 19:28:11 GMT]]></title><description><![CDATA[<p dir="auto">I think that you are doing your work at the wrong level. Why <em>is</em> AVehicle a QAbstractTableModel? Wouldn't it make much more sense to let AVehicle <em>have</em> a QAbstractTableModel? That also makes it easy to make the distinction between the two lists/tables you need to feed your data to.</p>
<p dir="auto">You should see the item models are merely an <em>interface</em> to your data, but they should not <em>be</em> the data object. Take a look at "this more detailed explanation":<a href="http://developer.qt.nokia.com/doc/qt-4.7/model-view-programming.html#note-13" target="_blank" rel="noopener noreferrer nofollow ugc">http://developer.qt.nokia.com/doc/qt-4.7/model-view-programming.html#note-13</a> that I wrote down in the documentation.</p>
]]></description><link>https://forum.qt.io/post/120717</link><guid isPermaLink="true">https://forum.qt.io/post/120717</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Thu, 15 Dec 2011 19:28:11 GMT</pubDate></item></channel></rss>