2

Is it possible to draw an animated text with QPainter?
I only want to change color of text periodically.
If possible how to achieve?

onurozcelik
  • 1,214
  • 3
  • 21
  • 44

1 Answers1

2

You need to create new slot in which you will change variable storing color you use to paint text. In the end of that slot you call

update();

to redraw widget.

To do it periodically you need also QTimer connected to that slot. In paintEvent you set color variable to pen or brush ( I don't remember which is used to draw text) used by QPainter.

That's all.

p.i.g.
  • 2,815
  • 2
  • 24
  • 41
firescreamer
  • 620
  • 8
  • 20