<div dir="ltr">Hello,<div><br></div><div>I'm trying to draw a static text from html code received from a QTextEdit. The first time I set the text normaly without html:</div><div>teLabel->setText("Textmarke");</div><div><br></div><div>then I mark in the TextEdit field the part "arke" of the above text and change the color with</div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">teLabel</span>-><span style="color:rgb(0,103,124)">setTextColor</span>(<span style="color:rgb(9,46,100)">color</span>);</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">From the textEdit I get the following HTML Code:</pre></div><div><br></div><div><p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "<a href="http://www.w3.org/TR/REC-html40/strict.dtd">http://www.w3.org/TR/REC-html40/strict.dtd</a>"></span></p>
<p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)"><html><head><meta name="qrichtext" content="1" /><style type="text/css"></span></p>
<p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)">p, li { white-space: pre-wrap; }</span></p>
<p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)"></style></head><body style=" font-family:''; font-size:12pt; font-weight:400; font-style:normal;"></span></p>
<p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Textm<span style=" color:#ff0000;">arke</span></p></body></html></span></p><p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)"><br></span></p><p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(0,0,0)">I store this String in a QStaticText (</span><span style="color:rgb(128,0,0)">staticText)</span><span style="color:rgb(0,0,0)"> and draw this text with</span></p><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(9,46,100)">painter</span>-><span style="color:rgb(0,103,124)">drawStaticText</span>(<span style="color:rgb(128,0,128)">QPoint</span>(-<span style="color:rgb(9,46,100)">w</span>/<span style="color:rgb(0,0,128)">2</span>,-<span style="color:rgb(9,46,100)">h</span>/<span style="color:rgb(0,0,128)">2</span>),<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">staticText</span>);</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif">But the result is that the hole text is red and not only the part "arke"</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif">Do anybody know why I get the complete text red and not only a part?</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif">Best regards,</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif">Martin</font></pre></div><div><br></div></div>