<div dir="ltr"><div class="gmail-post-text">

<p>I use method1 to find some text in qtablewidget rows.</p><p>
method1 :</p>

<pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-kwd">def</span><span class="gmail-pln"> </span><span class="gmail-typ">FindItem</span><span class="gmail-pun">(</span><span class="gmail-pln">self</span><span class="gmail-pun">):</span><span class="gmail-pln">
    items </span><span class="gmail-pun">=</span><span class="gmail-pln"> self</span><span class="gmail-pun">.</span><span class="gmail-typ">SuraBRS</span><span class="gmail-pun">.</span><span class="gmail-pln">findItems</span><span class="gmail-pun">(</span><span class="gmail-pln">
        self</span><span class="gmail-pun">.</span><span class="gmail-typ">SearchTbox</span><span class="gmail-pun">.</span><span class="gmail-pln">text</span><span class="gmail-pun">(),</span><span class="gmail-pln"> </span><span class="gmail-typ">QtCore</span><span class="gmail-pun">.</span><span class="gmail-typ">Qt</span><span class="gmail-pun">.</span><span class="gmail-typ">MatchContains</span><span class="gmail-pun">)</span><span class="gmail-pln">
    </span><span class="gmail-kwd">if</span><span class="gmail-pln"> items</span><span class="gmail-pun">:</span><span class="gmail-pln">
        results </span><span class="gmail-pun">=</span><span class="gmail-pln"> </span><span class="gmail-str">'\n'</span><span class="gmail-pun">.</span><span class="gmail-pln">join</span><span class="gmail-pun">(</span><span class="gmail-pln">
            </span><span class="gmail-str">'row %d column %d'</span><span class="gmail-pln"> </span><span class="gmail-pun">%</span><span class="gmail-pln"> </span><span class="gmail-pun">(</span><span class="gmail-pln">item</span><span class="gmail-pun">.</span><span class="gmail-pln">row</span><span class="gmail-pun">()</span><span class="gmail-pln"> </span><span class="gmail-pun">+</span><span class="gmail-pln"> </span><span class="gmail-lit">1</span><span class="gmail-pun">,</span><span class="gmail-pln"> item</span><span class="gmail-pun">.</span><span class="gmail-pln">column</span><span class="gmail-pun">()</span><span class="gmail-pln"> </span><span class="gmail-pun">+</span><span class="gmail-pln"> </span><span class="gmail-lit">1</span><span class="gmail-pun">)</span><span class="gmail-pln">
            </span><span class="gmail-kwd">for</span><span class="gmail-pln"> item </span><span class="gmail-kwd">in</span><span class="gmail-pln"> items</span><span class="gmail-pun">)</span><span class="gmail-pln">
    </span><span class="gmail-kwd">else</span><span class="gmail-pun">:</span><span class="gmail-pln">
        results </span><span class="gmail-pun">=</span><span class="gmail-pln"> </span><span class="gmail-str">'Found Nothing'</span><span class="gmail-pln">
    </span><span class="gmail-kwd">print</span><span class="gmail-pun">(</span><span class="gmail-pln">results</span><span class="gmail-pun">)</span></code></pre>

<p>Now I want to know how to highlight results or change their color.<strong>I want to select and highlight that text or character not all of the row or column</strong>.</p>
    </div></div>