<?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[sorting by multiple column in QSqlRelationalTableModel]]></title><description><![CDATA[<p dir="auto">Hi All,<br />
basically i want achieve something similar to below sqlite command in "QSqlRelationalTableModel"<br />
SELECT * FROM TABLE ORDER BY column1,column2 desc;<br />
but the limitation of QSqlRelationalTableModel is that setsort() or sort() functions can sort by only one column.<br />
How can i solve this issue?</p>
]]></description><link>https://forum.qt.io/topic/96123/sorting-by-multiple-column-in-qsqlrelationaltablemodel</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 10:47:42 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/96123.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 30 Oct 2018 18:39:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to sorting by multiple column in QSqlRelationalTableModel on Tue, 30 Oct 2018 19:34:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/divaindie">@<bdi>divaindie</bdi></a><br />
<a href="https://forum.qt.io/topic/23604/qsqltablemodel-sorting-by-multiple-columns/3">https://forum.qt.io/topic/23604/qsqltablemodel-sorting-by-multiple-columns/3</a></p>
<blockquote>
<p dir="auto">andre<br />
6 years ago<br />
Sorting on multiple columns can, AFAIK, only be done using your own query, or using a custom subclass of QSortFilterProxyModel in which you reimplement bool lessThan(const QModelIndex&amp; left, const QModelIndex&amp; right) const.</p>
</blockquote>
<p dir="auto">Also <a href="https://stackoverflow.com/questions/10893843/qsortfilterproxymodel-sort-multiple-columns" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/10893843/qsortfilterproxymodel-sort-multiple-columns</a></p>
]]></description><link>https://forum.qt.io/post/490110</link><guid isPermaLink="true">https://forum.qt.io/post/490110</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 30 Oct 2018 19:34:37 GMT</pubDate></item></channel></rss>