<?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[QCombobox with model: Can&#x27;t select from list]]></title><description><![CDATA[<p dir="auto">I am seeing some weird behavior from my QCombobox, and I'm hoping someone can help me understand what is going on.</p>
<p dir="auto">I've got a dialog that has a QCombobox in it.  I am using a QAbstractListModel and QSortFilterProxyModel to populate the QCombobox's list view.  This all seems to be working.</p>
<p dir="auto">Initially the list is empty.  If type a new entry into the QCombobox and click on my 'OK' button, the CurrentIndex is set to -1 (which I expect), and I add the new entry to my data source.  This all seems to be working.</p>
<p dir="auto">If I open my dialog again (now there is one item in the list), I can click on the drop-down arrow on the QCombobox, and I will see the new entry in the list, but I cannot select it.  Even if I don't view the list, if I type a new entry into the QCombobox and click 'OK', I find the CurrentIndex is set to 0.</p>
<p dir="auto">What am I doing wrong?</p>
]]></description><link>https://forum.qt.io/topic/16030/qcombobox-with-model-can-t-select-from-list</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 20:35:32 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/16030.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Apr 2012 15:31:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QCombobox with model: Can&#x27;t select from list on Tue, 08 Oct 2013 07:47:33 GMT]]></title><description><![CDATA[<p dir="auto">In the virtual function data() , when the <em>role == Item::EditRole | Item::DisplayRole</em>, valid data should be returned.</p>
]]></description><link>https://forum.qt.io/post/151397</link><guid isPermaLink="true">https://forum.qt.io/post/151397</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 08 Oct 2013 07:47:33 GMT</pubDate></item><item><title><![CDATA[Reply to QCombobox with model: Can&#x27;t select from list on Thu, 19 Apr 2012 16:17:30 GMT]]></title><description><![CDATA[<p dir="auto">I added a list view, and it looks correct.  I also noticed that if I don't try to select from the combobox's list, my currentIndex stays at -1 like it should.</p>
<p dir="auto">If I try to select from the list, the currentIndex is updated correctly, but the selected item is not displayed by the combobox.</p>
]]></description><link>https://forum.qt.io/post/136323</link><guid isPermaLink="true">https://forum.qt.io/post/136323</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 19 Apr 2012 16:17:30 GMT</pubDate></item><item><title><![CDATA[Reply to QCombobox with model: Can&#x27;t select from list on Thu, 19 Apr 2012 16:00:29 GMT]]></title><description><![CDATA[<p dir="auto">Could you verify that the model behaves as expected outside of the contect of a QComboBox? Preferably by using the ModelTest tool, but if needed by just putting it in a list view?</p>
]]></description><link>https://forum.qt.io/post/136320</link><guid isPermaLink="true">https://forum.qt.io/post/136320</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Thu, 19 Apr 2012 16:00:29 GMT</pubDate></item></channel></rss>