<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi<br></div>I use the following code for qcompleter .In this method if you write "c" then you can just choose  "completion" or any other is starts with "c" in the stringlist.<br><pre dir="ltr" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6" lang="en"><span class="gmail-line"><span class="gmail-String"></span><span class="gmail-String"></span></span></pre><pre dir="ltr" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6" lang="en"><span class="gmail-line"><span class="gmail-ResWord">def</span> <span class="gmail-ID">get_data</span>(<span class="gmail-ID">model</span>):</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_6"></span><span class="gmail-anchor" id="gmail-line-6-1"></span>    <span class="gmail-ID">model</span>.<span class="gmail-ID">setStringList</span>([<span class="gmail-String">"</span><span class="gmail-String">completion</span><span class="gmail-String">"</span>, <span class="gmail-String">"</span><span class="gmail-String">data</span><span class="gmail-String">"</span>, <span class="gmail-String">"</span><span class="gmail-String">goes</span><span class="gmail-String">"</span>, <span class="gmail-String">"</span><span class="gmail-String">here</span><span class="gmail-String">"</span>])</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_7"></span><span class="gmail-anchor" id="gmail-line-7-1"></span></span><span class="gmail-line">    <span class="gmail-ID">edit</span> = <span class="gmail-ID">QLineEdit</span>()</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_12"></span><span class="gmail-anchor" id="gmail-line-12-1"></span>    <span class="gmail-ID">completer</span> = <span class="gmail-ID">QCompleter</span>()</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_13"></span><span class="gmail-anchor" id="gmail-line-13-1"></span>    <span class="gmail-ID">edit</span>.<span class="gmail-ID">setCompleter</span>(<span class="gmail-ID">completer</span>)</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_14"></span><span class="gmail-anchor" id="gmail-line-14-1"></span></span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_15"></span><span class="gmail-anchor" id="gmail-line-15-1"></span>    <span class="gmail-ID">model</span> = <span class="gmail-ID">QStringListModel</span>()</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_16"></span><span class="gmail-anchor" id="gmail-line-16-1"></span>    <span class="gmail-ID">completer</span>.<span class="gmail-ID">setModel</span>(<span class="gmail-ID">model</span>)</span>
<span class="gmail-line"><span class="gmail-LineAnchor" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6_17"></span><span class="gmail-anchor" id="gmail-line-17-1"></span>    <span class="gmail-ID">get_data</span>(<span class="gmail-ID">model</span>)</span></pre> how could I replace a character that is not related to the input.for example :<br></div><div>   <br><pre dir="ltr" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6" lang="en"><span class="gmail-line"><span class="gmail-ID">StringList</span>([<span class="gmail-String">"</span>b","a","c","d"]) </span></pre></div><div>I want to be able when a key like  <b><font size="4">"h"</font></b> pressed or input the completer menu appears and would be able to choose "b"or"a"or"c"or"d" and <font size="4"><b>replace</b></font> it in the qlineedit character.<br></div><div><pre dir="ltr" id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6" lang="en"><span class="gmail-line"><span class="gmail-ID">    </span><br></span></pre><pre id="gmail-CA-4a740dd9ec74d342f1fd7cf168ceb0b12629eab6" lang="en"><span class="gmail-line"><br></span></pre></div></div></div></div></div></div></div>