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. limit of number of items in QGraphicsScene

limit of number of items in QGraphicsScene

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicsscene
4 Posts 2 Posters 1.6k 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.
  • chris_dC Offline
    chris_dC Offline
    chris_d
    wrote on last edited by
    #1

    I just started investigating Qt5's QGraphicsScene if it could be a base for an application port. The base of the application workspace is a matrix of up to 5,500 by 5,500 positions. My first shot was changing the chip example to use this number of items but this seems to be too much. Using half the amount needs around 8GB of memory.
    So my question at first is, if there is any limit for the number of items in one scene?
    Second could be if there is any mechanism to reduce the amount of items as there a many equal items. I'm thinking about creating one item with multiple positions (like point sprites in OSG).
    The environment for the development is opensuse 13.X, 64 bit.

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

      Why do you need 30.250.000 items in the scene at the same time?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • chris_dC Offline
        chris_dC Offline
        chris_d
        wrote on last edited by
        #3

        Well, this raster is the base for editing. I'm not sure if I really need all the items at one time. Could be also possible to page in only those items which are visible currently. But if I understand the documentation currently I have to define the overall dimension of the scene at the very beginning.

        1 Reply Last reply
        0
        • chris_dC Offline
          chris_dC Offline
          chris_d
          wrote on last edited by
          #4

          I implemented some kind of clipping done in the MainWindow's paintEvent(). This leads to a satisfying number of items. But the question: Is this the right place to remove and / or create scene items?

          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