Important: Please read the Qt Code of Conduct -

QGraphicsView Painting Intersected Areas with Different Color

  • Hello,
    I draw circles with increasing their rectangle area and then draw lines with different angles with the code below. And that creates intersected areas.

    Cell image

    What I would like to do is to fill every cell shown in the picture with different colors. I tried to get PainterPath of these each cells but I could not figure it out how to do it.

    int rVal = 60;
     int increaseVal = rVal;
     QRect center = QRect(mScene->width()/2-(rVal/2),mScene->height()/2-(rVal/2),rVal,rVal);
     QPen pen(Qt::red);
     int lastval;
     for (int i = 0 ;i < 10 ; ++i)
         center = QRect(mScene->width()/2-(rVal/2),mScene->height()/2-(rVal/2),rVal,rVal);
         lastval = rVal;
     QLineF angleline;
     /* Set the origin: */
     double angleSize =14.4;
     for (int i =0 ;i < 25; ++i)
         angleSize += 14.4;

    Thanks for any suggestions

Log in to reply