And it's totally irrelevant to show us how you attempt to do it, right? 
void paint(...)
{
const QRectF bounds
= boundingRect
();
linearGradient.setColorAt(0.0, Qt::white);
linearGradient.
setColorAt(1.0,
QColor(253,
85,
85));
//linearGradient.setColorAt(1.0, Qt::black);
painter->setBrush(linearGradient);
painter->drawRect(bounds);
}
void paint(...)
{
const QRectF bounds = boundingRect();
QLinearGradient linearGradient(bounds.topLeft(), bounds.bottomRight());
linearGradient.setColorAt(0.0, Qt::white);
linearGradient.setColorAt(1.0, QColor(253,85,85));
//linearGradient.setColorAt(1.0, Qt::black);
painter->setBrush(linearGradient);
painter->drawRect(bounds);
}
To copy to clipboard, switch view to plain text mode
Bookmarks