And it's totally irrelevant to show us how you attempt to do it, right?

Qt Code:
  1. void paint(...)
  2. {
  3. const QRectF bounds = boundingRect();
  4. QLinearGradient linearGradient(bounds.topLeft(), bounds.bottomRight());
  5. linearGradient.setColorAt(0.0, Qt::white);
  6. linearGradient.setColorAt(1.0, QColor(253,85,85));
  7. //linearGradient.setColorAt(1.0, Qt::black);
  8. painter->setBrush(linearGradient);
  9. painter->drawRect(bounds);
  10. }
To copy to clipboard, switch view to plain text mode