<?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[Filter a QListView with the content of a QLineEdit]]></title><description><![CDATA[<p dir="auto">Hi all<br />
My QListView looks like this:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/2bbad5a7-3038-4482-9083-fba51aafc13f.png" alt="736e2212-7c11-4567-9e6e-1d076cb45bfc-grafik.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Now I want to filter the first column (Projekt) to the content of a QLineEdit.</p>
<pre><code>void MainWindow::on_txt_projekt_2_textEdited(const QString &amp;arg1){
    extern QStandardItemModel globalEtiketten;
    QSortFilterProxyModel tempmodel;
    tempmodel.setSourceModel(&amp;globalEtiketten);
    tempmodel.setFilterCaseSensitivity(Qt::CaseInsensitive);
    tempmodel.setFilterKeyColumn(0);
    tempmodel.setFilterWildcard(arg1);
    ui-&gt;etikettenView-&gt;setModel(&amp;tempmodel);
}
</code></pre>
<p dir="auto">But after pressing for example "4" in the QLineEdit, the table is empty.</p>
<p dir="auto">As the code gets compiled without error, I think I have given some parameter wrong. Who can tell me which one?</p>
<p dir="auto">Thank you<br />
Thomas</p>
]]></description><link>https://forum.qt.io/topic/157275/filter-a-qlistview-with-the-content-of-a-qlineedit</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 15:04:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/157275.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Jun 2024 08:16:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Filter a QListView with the content of a QLineEdit on Sun, 16 Jun 2024 18:39:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomas-63">@<bdi>Thomas-63</bdi></a> please tell us that you have made it a class member variable and not a static.</p>
]]></description><link>https://forum.qt.io/post/802763</link><guid isPermaLink="true">https://forum.qt.io/post/802763</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 16 Jun 2024 18:39:04 GMT</pubDate></item><item><title><![CDATA[Reply to Filter a QListView with the content of a QLineEdit on Sun, 16 Jun 2024 09:15:47 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that was it! Thanks!</p>
]]></description><link>https://forum.qt.io/post/802746</link><guid isPermaLink="true">https://forum.qt.io/post/802746</guid><dc:creator><![CDATA[Thomas 63]]></dc:creator><pubDate>Sun, 16 Jun 2024 09:15:47 GMT</pubDate></item><item><title><![CDATA[Reply to Filter a QListView with the content of a QLineEdit on Sun, 16 Jun 2024 09:11:17 GMT]]></title><description><![CDATA[<p dir="auto">Oh, i think it is limited to the function, right?<br />
Would it help to define it as external like the QStandardItemModel??</p>
]]></description><link>https://forum.qt.io/post/802745</link><guid isPermaLink="true">https://forum.qt.io/post/802745</guid><dc:creator><![CDATA[Thomas 63]]></dc:creator><pubDate>Sun, 16 Jun 2024 09:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to Filter a QListView with the content of a QLineEdit on Sun, 16 Jun 2024 09:07:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomas-63">@<bdi>Thomas-63</bdi></a> said in <a href="/post/802742">Filter a QListView with the content of a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">QSortFilterProxyModel tempmodel;</p>
</blockquote>
<p dir="auto">Basic c++ - what's the lifetime of this object?</p>
]]></description><link>https://forum.qt.io/post/802744</link><guid isPermaLink="true">https://forum.qt.io/post/802744</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sun, 16 Jun 2024 09:07:51 GMT</pubDate></item></channel></rss>