<?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[SortFilterProxyModel and modelData]]></title><description><![CDATA[<p dir="auto">How can I use StringSorter or RoleSorter with custom c++ models that are normally accessed by modelData?</p>
<pre><code>ListView {
  anchors.fill: parent
  model: SortFilterProxyModel {
    model: myCustomModel

    sorters: StringSorter {
      roleName: "name"
    }
  }

  delegate: Text {
    required property var modelData
    text: modelData.name
  }
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/163996/sortfilterproxymodel-and-modeldata</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 02:50:39 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163996.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Dec 2025 22:28:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SortFilterProxyModel and modelData on Sun, 28 Dec 2025 20:26:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ashley-paul">@<bdi>Ashley-Paul</bdi></a> You can't, those work based on roles.</p>
<p dir="auto">If your model is a list of QObject* I would suggest using <a href="https://github.com/OlivierLDff/ObjectListModel/" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/OlivierLDff/ObjectListModel/</a> or QRangeModel as your model.</p>
]]></description><link>https://forum.qt.io/post/834945</link><guid isPermaLink="true">https://forum.qt.io/post/834945</guid><dc:creator><![CDATA[GrecKo]]></dc:creator><pubDate>Sun, 28 Dec 2025 20:26:20 GMT</pubDate></item></channel></rss>