It could be that you Need to add "QTextEdit{ %1 }" to your spec.
Rather what I prefer to do is set the stylesheet for the whole app in the 
main.cpp.

To specifically target this textbox and not every textbox, you can use:
QTextEdit#objectName { }




________________________________
 From: Graham Labdon <graham.lab...@avalonsciences.com>
To: Jason H <scorp...@yahoo.com> 
Cc: "interest@qt-project.org" <interest@qt-project.org> 
Sent: Monday, March 12, 2012 9:12 AM
Subject: RE: [Interest] QTextEdit and Style sheets
 

 
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
 
Any other ideas?
 
From:interest-bounces+graham.labdon=avalonsciences....@qt-project.org 
[mailto:interest-bounces+graham.labdon=avalonsciences....@qt-project.org] On 
Behalf Of Jason H
Sent: 12 March 2012 12:23
To: interest@qt-project.org; graham.lab...@hotmail.co.uk
Subject: Re: [Interest] QTextEdit and Style sheets
 
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. 
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()


-J 
 

________________________________
 
From: graham labdon <graham.lab...@hotmail.co.uk>; 
To: <interest@qt-project.org>; 
Subject: [Interest] QTextEdit and Style sheets 
Sent: Mon, Mar 12, 2012 10:03:30 AM 
Hi
I am trying to set a background image on a QTextEdit using setStyleSheet -

textEdit->setStyleSheet(QString::fromUtf8("background-image:url(:/images/Chrysanthemum.png);background-attachment:fixed"));

However, this doe not work.

Am i misunderstanding the documentation or is it not possible?

Thanks 
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to