<div dir="ltr"><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9.1pt"><span style="color:rgb(0,0,128);font-weight:bold">For more Info I have to say that I first find what I want with below code in sqlite.after that I use the other code with regix to highlight results.<br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9.1pt"><span style="color:rgb(0,0,128);font-weight:bold">and another reason is that its gonna be faster.And I can not count results in sqlite if there are more that on results in a row.<br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9.1pt"><span style="color:rgb(0,0,128);font-weight:bold"><br>with </span>conn:<br>    cur = conn.cursor()<br>    conn.text_factory = <span style="color:rgb(0,0,128)">str<br></span><span style="color:rgb(0,0,128)">   </span><span style="color:rgb(0,128,128);font-weight:bold"></span><span style="color:rgb(0,128,128);font-weight:bold">   </span><br>        qury = (<span style="color:rgb(0,128,128);font-weight:bold">" SELECT * FROM Translation WHERE table LIKE '%{0}%';"</span>).format(<span style="color:rgb(148,85,141)">self</span>.lineEdit.text())<br>        cur.execute(qury)<br>        <span style="color:rgb(148,85,141)">self</span>.all_rows = cur.fetchall()<br>        a = <span style="color:rgb(0,0,255)">1<br></span><span style="color:rgb(0,0,255)">        </span><span style="color:rgb(0,0,128);font-weight:bold">for </span>row <span style="color:rgb(0,0,128);font-weight:bold">in </span><span style="color:rgb(148,85,141)">self</span>.all_rows:<br>            <span style="color:rgb(148,85,141)">self</span>.SearchResults.append(<span style="color:rgb(0,128,128);font-weight:bold">'{0} )- {1} </span><span style="color:rgb(0,128,128);font-weight:bold;font-family:"Aldhabi"">﴿</span><span style="color:rgb(0,128,128);font-weight:bold"> {2}:mjp ={3} </span><span style="color:rgb(0,128,128);font-weight:bold;font-family:"Aldhabi"">﴾</span><span style="color:rgb(0,128,128);font-weight:bold">'</span>.format(a, row[<span style="color:rgb(0,0,255)">4</span>], row[<span style="color:rgb(0,0,255)">2</span>], row[<span style="color:rgb(0,0,255)">1</span>]))<br>            <span style="color:rgb(148,85,141)">self</span>.SearchResults.append(<span style="color:rgb(0,128,128);font-weight:bold">'{0} '</span>.format((row[<span style="color:rgb(0,0,255)">3</span>])))<br>            <span style="color:rgb(148,85,141)">self</span>.SearchResults.append(<span style="color:rgb(0,128,128);font-weight:bold">""</span>)<br>            a = a + <span style="color:rgb(0,0,255)">1</span></pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 19, 2018 at 8:49 PM, Maziar Parsijani <span dir="ltr"><<a href="mailto:maziar.parsijani@gmail.com" target="_blank">maziar.parsijani@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes thats not help full because it is important for me to foreground the results all together. For example: "Hello world"is my text when I want to search "l"I want it to be highlighted .I couldn't do that with QTextEdit::find.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 19, 2018 at 8:34 PM, Florian Bruhin <span dir="ltr"><<a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Sun, Aug 19, 2018 at 08:31:13PM +0430, Maziar Parsijani wrote:<br>
> I use the below code to search in qtextedit to match a word.Are there any<br>
> better Idea.<br>
<br>
</span>Are you aware that there's a QTextEdit::find method?<br>
<span class="m_-5458833743828246069HOEnZb"><font color="#888888"><br>
Florian<br>
<br>
-- <br>
<a href="https://www.qutebrowser.org" rel="noreferrer" target="_blank">https://www.qutebrowser.org</a> | <a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a> (Mail/XMPP)<br>
   GPG: 916E B0C8 FD55 A072 | <a href="https://the-compiler.org/pubkey.asc" rel="noreferrer" target="_blank">https://the-compiler.org/pubke<wbr>y.asc</a><br>
         I love long mails! | <a href="https://email.is-not-s.ms/" rel="noreferrer" target="_blank">https://email.is-not-s.ms/</a><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>