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. Drawing the same thing multiple times, with different Z values

Drawing the same thing multiple times, with different Z values

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 441 Views
  • 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.
  • P Offline
    P Offline
    Pippin
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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 :)

      1 Reply Last reply
      1

      • Login

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