<?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[How to get the text of a complete in a combobox]]></title><description><![CDATA[<p dir="auto">Hi Can someone help me with my problem, I have a combobox that I fill with a QList and now I have generated a search engine with the help of the QCompleter, so far everything is fine, but I have edited it to make it visually more attractive, and it worked correctly until I have trouble selecting with the mouse one of the options that the QCompleter threw at me and the selection does not respect me, it only respects me if I give an Enter with the keyboard, but only for a moment, someone could help me solve my problem.</p>
<pre><code>MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);
 qApp-&gt;setStyleSheet("QAbstractItemView#completerPopup {font: 15pt ;color: rgb(255, 255, 255);}");
}
</code></pre>
<pre><code>    QCompleter *completer = new QCompleter(list, this);
    completer-&gt;setFilterMode(Qt::MatchContains);
    completer-&gt;setCaseSensitivity(Qt::CaseInsensitive);
    completer-&gt;popup()-&gt;setObjectName("completerPopup");
    ui-&gt;cobobox-&gt;setCompleter(completer);
</code></pre>
<p dir="auto">I manage to make it work but I have to remove some lines of code that are the ones that help me edit the QCompleter as Pupop.</p>
<pre><code>    QCompleter *completer = new QCompleter(list, this);
    completer-&gt;setFilterMode(Qt::MatchContains);
    completer-&gt;setCaseSensitivity(Qt::CaseInsensitive);
    ui-&gt;cobobox-&gt;setCompleter(completer);
</code></pre>
<p dir="auto">The error it throws when I select is the following<br />
Setting a QCompleter on non-editable QComboBox is not allowed.</p>
]]></description><link>https://forum.qt.io/topic/116629/how-to-get-the-text-of-a-complete-in-a-combobox</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 03:38:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/116629.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Jul 2020 19:30:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to get the text of a complete in a combobox on Fri, 03 Jul 2020 21:37:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/morado">@<bdi>Morado</bdi></a><br />
It was you who wrote</p>
<blockquote>
<p dir="auto">The error it throws when I select is the following</p>
<p dir="auto">Setting a QCompleter on non-editable QComboBox is not allowed.</p>
</blockquote>
<p dir="auto">That's all I know.</p>
]]></description><link>https://forum.qt.io/post/604601</link><guid isPermaLink="true">https://forum.qt.io/post/604601</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 03 Jul 2020 21:37:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to get the text of a complete in a combobox on Fri, 03 Jul 2020 20:59:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a></p>
<p dir="auto">I was reviewing the documentation and enabling setEditable only allows me to write to the Combobox and I have already achieved this from the GUI, my problem is that it does not allow me to select from the popup with the mouse. But with keyboard yes.</p>
]]></description><link>https://forum.qt.io/post/604600</link><guid isPermaLink="true">https://forum.qt.io/post/604600</guid><dc:creator><![CDATA[Morado]]></dc:creator><pubDate>Fri, 03 Jul 2020 20:59:28 GMT</pubDate></item><item><title><![CDATA[Reply to How to get the text of a complete in a combobox on Fri, 03 Jul 2020 20:40:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a><br />
I had just done it before you answered me, and it doesn't affect it in the same way.</p>
<pre><code>ui-&gt;combobox-&gt;setEditable(true);
ui-&gt;combobox-&gt;setCompleter(completer);
</code></pre>
<p dir="auto">or  I am doing something wrong again?</p>
]]></description><link>https://forum.qt.io/post/604597</link><guid isPermaLink="true">https://forum.qt.io/post/604597</guid><dc:creator><![CDATA[Morado]]></dc:creator><pubDate>Fri, 03 Jul 2020 20:40:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to get the text of a complete in a combobox on Fri, 03 Jul 2020 20:28:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/morado">@<bdi>Morado</bdi></a><br />
Did you do the <code>setEditable(true)</code> per the link?  That is what makes the <code>QComboBox</code> editable.  <code>setInsertPolicy()</code> is irrelevant.</p>
<p dir="auto">The default <code>QComboBox</code> is just a dropdown non-editable list.  It does not accept text input, so a <code>QCompleter</code> makes no sense.  You have to set it editable to get an edit widget and a completer.</p>
]]></description><link>https://forum.qt.io/post/604593</link><guid isPermaLink="true">https://forum.qt.io/post/604593</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 03 Jul 2020 20:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to How to get the text of a complete in a combobox on Fri, 03 Jul 2020 20:04:04 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for responding so quickly,I try this</p>
<pre><code>ui-&gt;combobox-&gt;setInsertPolicy(QComboBox::InsertAtCurrent);
</code></pre>
<p dir="auto">And with all its possible combinations:</p>
<pre><code>QComboBox::InsertAtTop
QComboBox::InsertAtBottom
QComboBox::InsertAfterCurrent
QComboBox::InsertBeforeCurrent
QComboBox::InsertAlphabetically
</code></pre>
<p dir="auto">But it did not give me any favorable results.<br />
Or is it that I'm wrong about something?</p>
]]></description><link>https://forum.qt.io/post/604591</link><guid isPermaLink="true">https://forum.qt.io/post/604591</guid><dc:creator><![CDATA[Morado]]></dc:creator><pubDate>Fri, 03 Jul 2020 20:04:04 GMT</pubDate></item><item><title><![CDATA[Reply to How to get the text of a complete in a combobox on Fri, 03 Jul 2020 19:36:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/morado">@<bdi>Morado</bdi></a> said in <a href="/post/604585">How to get the text of a complete in a combobox</a>:</p>
<blockquote>
<p dir="auto">Setting a QCompleter on non-editable QComboBox is not allowed.</p>
</blockquote>
<p dir="auto"><a href="https://doc.qt.io/qt-5/qcombobox.html#editable-prop" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qcombobox.html#editable-prop</a></p>
<blockquote>
<p dir="auto">This property holds whether the combo box can be edited by the user</p>
<p dir="auto">By default, this property is false. The effect of editing depends on the insert policy.</p>
</blockquote>
]]></description><link>https://forum.qt.io/post/604586</link><guid isPermaLink="true">https://forum.qt.io/post/604586</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 03 Jul 2020 19:36:08 GMT</pubDate></item></channel></rss>