PDA

View Full Version : Text Effects



BigEd
20th January 2009, 15:18
Hi,

I am wanting to fade out the text on a QLabel to be transparent, then change the text, and fade back to black with the new text showing. The text is coming out of a data file so I can't create myself a movie in advance so I need to do it on the fly.

I can change it instantly but thought it might look better with an effect, since I had that thought I have regretted it ever since :crying:

I am currently using Qt3 and python and am stuggling to come up with a solution. I have read some bit about Qt4 and am wondering if it may be easier with that.

Any ideas would be welcomed.

Many Thanks in advance

BigEd

jpn
24th January 2009, 18:06
Run a timer to change the text color. I think the approach would be pretty similar in both Qt 3 and Qt 4, just change the text color from the palette.

BigEd
26th January 2009, 08:31
This is slightly complicated by the fact I have an image as the background on the window so whats behind the text label is not solid colour. So I need to fade to transparent somehow :confused:

jpn
26th January 2009, 08:58
QPalette palette = label->palette();
palette.setColor(QColorGroup::Text, QColor(qRgba(r, g, b, a))); // <-- 'a'
label->setPalette(palette);