[Interest] QTextEdit and Style sheets
Jason H
scorp1us at yahoo.com
Mon Mar 12 14:54:05 CET 2012
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.Labdon at avalonsciences.com>
To: Jason H <scorp1us at yahoo.com>
Cc: "interest at qt-project.org" <interest at 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.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>;
To: <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/71d96145/attachment.html>
More information about the Interest
mailing list