How to paint with QLinearGradient in QLabel?
Hello every body...
That's my 2 rd thread on this forum.
I have a pretty newbie question, how to paint with QLinearGradient on QLabel?
I have the code, but I don't know how to paint on label_3...
Code:
gradient.setColorAt(0.0,Qt::white);
gradient.setColorAt(0.1,Qt::black);
gradient.setColorAt(1.0,Qt::green);
gradient.start();
Should I set parent, or child or something like that ? ? ?
sorry for newbie questions.
Thanks.
Re: How to paint with QLinearGradient in QLabel?
Assuming you are trying to produce some sort of custom widget then you should sub-class QLabel, reimplement QWidget::paintEvent() and do your painting there. See the Analogue Clock Example.
You may be able to achieve a similar result using style sheets, particularly the background property
Re: How to paint with QLinearGradient in QLabel?