<?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[QSqlTableModel &amp; QtableView , how to sort by column?]]></title><description><![CDATA[<p dir="auto">Im trying to find what is the easy way to preform sorting on single table im Qurying from SQLite (im using all Qt build class's )<br />
i have QSqlTableModel delegated (as singletone)  class that im setting into QTableview<br />
like this:<br />
@ui-&gt;PlayList_tableView-&gt;resizeColumnsToContents();<br />
ui-&gt;PlayList_tableView-&gt;setSortingEnabled(true);<br />
ui-&gt;PlayList_tableView-&gt;setAlternatingRowColors(true);<br />
ui-&gt;PlayList_tableView-&gt;setModel(PlayListSqlModel::instance()); // this is where i set the model @<br />
and acurding to this "link ":<a href="http://www.qtforum.org/article/26898/how-to-sort-data-by-column-in-a-table-view-model-set-for-table-view-is-qsqlquerymodel-if-click-to-headerview.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.qtforum.org/article/26898/how-to-sort-data-by-column-in-a-table-view-model-set-for-table-view-is-qsqlquerymodel-if-click-to-headerview.html</a><br />
the sorting suppose to happen automatically , i do see the little sorting triangles in the headers but there is no sorting .<br />
what im doing wrong here ?</p>
]]></description><link>https://forum.qt.io/topic/13658/qsqltablemodel-qtableview-how-to-sort-by-column</link><generator>RSS for Node</generator><lastBuildDate>Wed, 06 May 2026 20:58:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/13658.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Feb 2012 19:35:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QSqlTableModel &amp; QtableView , how to sort by column? on Fri, 25 Oct 2013 10:23:35 GMT]]></title><description><![CDATA[<p dir="auto">Had the same problem and this worked! Thank you KillGabio.</p>
]]></description><link>https://forum.qt.io/post/151414</link><guid isPermaLink="true">https://forum.qt.io/post/151414</guid><dc:creator><![CDATA[Castorus]]></dc:creator><pubDate>Fri, 25 Oct 2013 10:23:35 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlTableModel &amp; QtableView , how to sort by column? on Wed, 01 Feb 2012 21:43:31 GMT]]></title><description><![CDATA[<p dir="auto">try using QSortFilterProxyModel</p>
<p dir="auto">an example:</p>
<p dir="auto">@    QSortFilterProxyModel *sort_filter = new QSortFilterProxyModel(this);<br />
sort_filter-&gt;setSourceModel(model);<br />
sort_filter-&gt;sort (0);<br />
this-&gt;ui-&gt;data_table-&gt;setModel (sort_filter);<br />
@</p>
]]></description><link>https://forum.qt.io/post/127821</link><guid isPermaLink="true">https://forum.qt.io/post/127821</guid><dc:creator><![CDATA[KillGabio]]></dc:creator><pubDate>Wed, 01 Feb 2012 21:43:31 GMT</pubDate></item></channel></rss>