[Interest] QTextEdit and Style sheets

Graham Labdon Graham.Labdon at avalonsciences.com
Mon Mar 12 14:12:27 CET 2012


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.com at qt-project.org [mailto:interest-bounces+graham.labdon=avalonsciences.com at qt-project.org] On Behalf Of Jason H
Sent: 12 March 2012 12:23
To: interest at qt-project.org; graham.labdon at 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.labdon at hotmail.co.uk<mailto:graham.labdon at hotmail.co.uk>>;
To: <interest at qt-project.org<mailto:interest at 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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120312/33b53adf/attachment.html>


More information about the Interest mailing list