Hello,
I would like to draw an ellipse and fill it with a QRadialGradient brush. So I have 2 questions:
  • what is the difference between focal and center points in a QRadialGradient?
  • here is my code, which draws a classical - empty - ellipse, what should I add to fill it with the selected brush?
    Qt Code:
    1. QRadialGradient rg(this->fire_point, this->fire_size);
    2. rg.setColorAt(0, Qt::red);
    3. rg.setColorAt(1, Qt::white);
    4. pen.setBrush(QBrush(rg));
    5. painter.setPen(pen);
    6. painter.drawEllipse(this->fire_point.x(), this->fire_point.y(), this->fire_size*2, this->fire_size*2);
    To copy to clipboard, switch view to plain text mode