Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Drawing the same thing multiple times, with different Z values



  • I would like to draw a polygon at different places in my QGraphicsView/QGraphicsScene, with different Z values. For example, I might need to draw that polygon in the top-right corner with a Z value of 15.f, and also in the bottom-left corner with a Z value of 30.f.

    Do I need to create an QGraphicsItem for each polygon, or is there a smarter way? Ideally, I would like to print that same polygon n times, rather than n polygons once.

    Thanks in advance.


  • Lifetime Qt Champion

    @Pippin said:

    hi
    QGraphicsView & QGraphicsScene are optimised for large number of items
    so not sure its worth to try to make some sort of sprite solution. ?

    I would just insert a new QGraphicsItem for each and be happy :)


Log in to reply