<?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[[Solved]Extracting data to display in QListView]]></title><description><![CDATA[<p dir="auto">I want to make my <em>QListView</em> bind to my <em>QSqlQueryModel</em>.  So far the below code works but will only display the first column data of each row(I believe, or it is counting each row that exist as 1,2,3...).  How can I make it so I can display say column 2 that holds a column name reference (ie: The 2,3,4 columns that will produce "Marry Joe Smith").</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/void">@<bdi>void</bdi></a> ListUI::addItem(QSqlQueryModel *model){<br />
theList-&gt;setModel(model);<br />
}@</p>
<p dir="auto">Output:<br />
1<br />
2<br />
3<br />
4</p>
]]></description><link>https://forum.qt.io/topic/19113/solved-extracting-data-to-display-in-qlistview</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 00:30:20 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/19113.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Aug 2012 08:45:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved]Extracting data to display in QListView on Thu, 16 Aug 2012 15:21:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qxoz">@<bdi>qxoz</bdi></a> thank you.  I had not seen that member.</p>
]]></description><link>https://forum.qt.io/post/147640</link><guid isPermaLink="true">https://forum.qt.io/post/147640</guid><dc:creator><![CDATA[weblife]]></dc:creator><pubDate>Thu, 16 Aug 2012 15:21:38 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Extracting data to display in QListView on Thu, 16 Aug 2012 12:49:06 GMT]]></title><description><![CDATA[<p dir="auto">I think you want this:<br />
@theList-&gt;setModelColumn(1);@</p>
<p dir="auto">Indexing of columns starts from 0</p>
]]></description><link>https://forum.qt.io/post/147614</link><guid isPermaLink="true">https://forum.qt.io/post/147614</guid><dc:creator><![CDATA[qxoz]]></dc:creator><pubDate>Thu, 16 Aug 2012 12:49:06 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Extracting data to display in QListView on Thu, 16 Aug 2012 10:00:38 GMT]]></title><description><![CDATA[<p dir="auto">Maybe to simple to say, but a list is a table with only 1 column if you ask me. If you want your model and view to have multiple columns you could use the QTableView.<br />
Or am I missing a part of the problem?</p>
]]></description><link>https://forum.qt.io/post/147587</link><guid isPermaLink="true">https://forum.qt.io/post/147587</guid><dc:creator><![CDATA[Jeroentjehome]]></dc:creator><pubDate>Thu, 16 Aug 2012 10:00:38 GMT</pubDate></item></channel></rss>