Qt-interest Archive, January 2007
change font color of items in qlistbox
Message 1 in thread
How do you change the font color of items listed in a qlistbox (qt3.3)
Message 2 in thread
For QT 3.3, you have to overload the paintevent, and set the pen.
Scott
________________________________
From: Ann Marie [mailto:annmarieqt@xxxxxxxxx]
Sent: Thursday, January 04, 2007 2:54 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: change font color of items in qlistbox
How do you change the font color of items listed in a qlistbox (qt3.3)
Message 3 in thread
so you need:
class MBoxText : public QListBoxText
{
public:
MBoxText(const QString& , QColor);
QColor tColor;
protected:
void paint(QPainter *);
};
MBoxText::MBoxText (const QString &text = QString::null, QColor color =
Qt::black)
: QListBoxText(text)
{
tColor = color;
}
void MBoxText::paint(QPainter *p)
{
p->setPen(tColor);
QListBoxText::paint(p);
}
> For QT 3.3, you have to overload the paintevent, and set the pen.
>
>
>
> Scott
>
>
>
> ------------------------------------------------------------------------
>
> *From:* Ann Marie [mailto:annmarieqt@xxxxxxxxx]
> *Sent:* Thursday, January 04, 2007 2:54 PM
> *To:* qt-interest@xxxxxxxxxxxxx
> *Subject:* change font color of items in qlistbox
>
>
>
> How do you change the font color of items listed in a qlistbox (qt3.3)
>
--
[ signature omitted ]
Message 4 in thread
What do you have to do for QT 4.2?
On 1/4/07, Scott Aron Bloom <scott@xxxxxxxxxxxx> wrote:
> >
> > For QT 3.3, you have to overload the paintevent, and set the pen.
> >
> >
> >
> > Scott
> >
> >
> > ------------------------------
> >
> > *From:* Ann Marie [mailto:annmarieqt@xxxxxxxxx]
> > *Sent:* Thursday, January 04, 2007 2:54 PM
> > *To:* qt-interest@xxxxxxxxxxxxx
> > *Subject:* change font color of items in qlistbox
> >
> >
> >
> > How do you change the font color of items listed in a qlistbox (qt3.3)
> >
> >
>
Message 5 in thread
For 4.X its trivial, overload the data method, and respond to the
Qt::TextColorRole role.
Return the color you want.
Scott
________________________________
From: Ann Marie [mailto:annmarieqt@xxxxxxxxx]
Sent: Thursday, January 04, 2007 3:27 PM
To: Qt Interest List
Subject: Re: change font color of items in qlistbox
What do you have to do for QT 4.2?
On 1/4/07, Scott Aron Bloom <scott@xxxxxxxxxxxx > wrote:
For QT 3.3, you have to overload the paintevent, and set the
pen.
Scott
________________________________
From: Ann Marie [mailto:annmarieqt@xxxxxxxxx]
Sent: Thursday, January 04, 2007 2:54 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: change font color of items in qlistbox
How do you change the font color of items listed in a qlistbox
(qt3.3)
Message 6 in thread
This should help: http://doc.trolltech.com/qq/qq08-fancy-list-view.html.
Sam Dutton
SAM DUTTON
SENIOR SITE DEVELOPER
200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK
________________________________
From: Ann Marie [mailto:annmarieqt@xxxxxxxxx]
Sent: Thursday 04 January 2007 22:54
To: qt-interest@xxxxxxxxxxxxx
Subject: change font color of items in qlistbox
How do you change the font color of items listed in a qlistbox (qt3.3)
Please Note:
Any views or opinions are solely those of the author and do not necessarily represent
those of Independent Television News Limited unless specifically stated.
This email and any files attached are confidential and intended solely for the use of the individual
or entity to which they are addressed.
If you have received this email in error, please notify postmaster@xxxxxxxxx
Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.
Thank You.

