Important: Please read the Qt Code of Conduct -

limit of number of items in QGraphicsScene

  • 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.

  • Lifetime Qt Champion

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

  • 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.

  • 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?

Log in to reply