<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>It could be that you Need to add "QTextEdit{ %1 }" to your spec.</span></div><div><span>Rather what I prefer to do is set the stylesheet for the whole app in the main.cpp.</span></div><div><br><span></span></div><div><span>To specifically target this textbox and not every textbox, you can use:</span></div><div><span>QTextEdit#objectName { }</span></div><div><span><br></span></div><div><span><br></span></div><div><br></div>  <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Graham Labdon <Graham.Labdon@avalonsciences.com><br> <b><span style="font-weight:
 bold;">To:</span></b> Jason H <scorp1us@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "interest@qt-project.org" <interest@qt-project.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, March 12, 2012 9:12 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> RE: [Interest] QTextEdit and Style sheets<br> </font> </div> <br>
<div id="yiv1796497633">

 
 
<style><!--
#yiv1796497633  
 _filtered #yiv1796497633 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
 _filtered #yiv1796497633 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
#yiv1796497633  
#yiv1796497633 p.yiv1796497633MsoNormal, #yiv1796497633 li.yiv1796497633MsoNormal, #yiv1796497633 div.yiv1796497633MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"serif";}
#yiv1796497633 a:link, #yiv1796497633 span.yiv1796497633MsoHyperlink
        {color:blue;text-decoration:underline;}
#yiv1796497633 a:visited, #yiv1796497633 span.yiv1796497633MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
#yiv1796497633 p
        {margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:"serif";}
#yiv1796497633 p.yiv1796497633MsoAcetate, #yiv1796497633 li.yiv1796497633MsoAcetate, #yiv1796497633 div.yiv1796497633MsoAcetate
        {margin:0cm;margin-bottom:.0001pt;font-size:8.0pt;font-family:"sans-serif";}
#yiv1796497633 span.yiv1796497633EmailStyle18
        {font-family:"sans-serif";color:#1F497D;}
#yiv1796497633 span.yiv1796497633BalloonTextChar
        {font-family:"sans-serif";}
#yiv1796497633 .yiv1796497633MsoChpDefault
        {font-family:"sans-serif";}
 _filtered #yiv1796497633 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}
#yiv1796497633 div.yiv1796497633WordSection1
        {}
--></style>

<div>
<div class="yiv1796497633WordSection1">
<div class="yiv1796497633MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">I realise that using the colon implies a compilied in resource but this resource exits and can be used to set the background image on a push button</span></div> 
<div class="yiv1796497633MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">  </span></div> 
<div class="yiv1796497633MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Any other ideas?</span></div> 
<div class="yiv1796497633MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">  </span></div> 
<div class="yiv1796497633MsoNormal"><b><span style="font-size:10.0pt;" lang="EN-US">From:</span></b><span style="font-size:10.0pt;" lang="EN-US"> interest-bounces+graham.labdon=avalonsciences.com@qt-project.org
 [mailto:interest-bounces+graham.labdon=avalonsciences.com@qt-project.org] <b>On Behalf Of
</b>Jason H<br>
<b>Sent:</b> 12 March 2012 12:23<br>
<b>To:</b> interest@qt-project.org; graham.labdon@hotmail.co.uk<br>
<b>Subject:</b> Re: [Interest] QTextEdit and Style sheets</span></div> 
<div class="yiv1796497633MsoNormal">  </div> 
<table class="yiv1796497633MsoNormalTable" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm;" valign="top">
<div>You've understanding it fine. But the colon in the filename means, it's a complied-in resource. While you develop/test, I would suggest taking the colon out and using the file system.
</div> 
<div style="margin-bottom:12.0pt;">All you have to do without using style sheets is subclass QTextEdit then re implement draw, draw your water mark, then cal the base class paint via QTextEdit::paintEvent()<br>
<br>
</div> 
<div>-J</div> 
</td>
</tr>
</tbody>
</table>
<div id="yiv1796497633_origMsg_">
<div>
<div class="yiv1796497633MsoNormal"><span style="font-size:10.0pt;">  </span></div> 
<div>
<div class="yiv1796497633MsoNormal" style="text-align:center;" align="center"><span style="font-size:10.0pt;">
<hr align="center" size="1" width="100%">
</span></div>
<div class="yiv1796497633MsoNormal" style="margin-bottom:12.0pt;"><b><span style="font-size:10.0pt;">From:
</span></b><span style="font-size:10.0pt;">graham labdon <<a rel="nofollow" ymailto="mailto:graham.labdon@hotmail.co.uk" target="_blank" href="mailto:graham.labdon@hotmail.co.uk">graham.labdon@hotmail.co.uk</a>>;
<br>
<b>To: </b><<a rel="nofollow" ymailto="mailto:interest@qt-project.org" target="_blank" href="mailto:interest@qt-project.org">interest@qt-project.org</a>>;
<br>
<b>Subject: </b>[Interest] QTextEdit and Style sheets <br>
<b>Sent: </b>Mon, Mar 12, 2012 10:03:30 AM </span></div> 
<table class="yiv1796497633MsoNormalTable" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm;" valign="top">
<div>
<div class="yiv1796497633MsoNormal">Hi<br>
I am trying to set a background image on a QTextEdit using setStyleSheet -<br>
<br>
<span style="color:maroon;">textEdit</span><span style="color:black;">-></span>setStyleSheet<span style="color:black;">(</span><span style="color:purple;">QString</span><span style="color:black;">::</span>fromUtf8<span style="color:black;">(</span><span style="color:green;">"background-image:</span><span style="color:silver;">
</span><span style="color:green;">url(:/images/Chrysanthemum.png);background-attachment:</span><span style="color:silver;">
</span><span style="color:green;">fixed"</span><span style="color:black;">));</span><br>
<br>
However, this doe not work.<br>
<br>
Am i misunderstanding the documentation or is it not possible?<br>
<br>
Thanks</div> 
</div>
</td>
</tr>
</tbody>
</table>
<div class="yiv1796497633MsoNormal"><span style="font-size:10.0pt;">  </span></div> 
</div>
</div>
</div>
</div>
</div>

</div><br><br> </div> </div>  </div></body></html>