Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Circle with radial gradient
Qt 6.11 is out! See what's new in the release blog

Circle with radial gradient

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RiseOfDeath
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved