Circle with radial gradient



  • hi. I want draw some circles with radial gradient, but is look like black circle.

    @QRadialGradient gradient(0, 0, 50,0,0);
    gradient.setColorAt(0, Qt::yellow);
    gradient.setColorAt(1, Qt::black);
    gradient.setSpread(QGradient::PadSpread);

    QBrush brush(gradient);
    brush.setStyle(Qt::RadialGradientPattern);
    QPainter painter(this);
    
    painter.setRenderHint(QPainter::Antialiasing);
    painter.setBrush(brush);
    painter.setPen(Qt::NoPen);
    
    
    for(int i=0;i<points.size();i++)
    {
        painter.drawEllipse(i*10, (points.at(i)*-1)+(this->height()/2),50,50);
    
    }@
    

    points is QList<float> and it not empty


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.