1
votes

I am using a QGraphicsView with hundreds of large QGraphicsItems in them. The QGraphicsItems are essentially QGraphicsPixmapItems because I am reading some raw data in from a file, and converting that into a QImage and then using the drawImage() painter.

The problem is, after I start getting a certain number of these items in my scene, OR just a single, very large one, the scene becomes really slow to respond. If I move the items, or try to zoom in/out on them, etc, the scene just takes forever to refresh. I would like it to be more interactive, instead of constantly waiting on the scene to refresh once all the data is loaded.

Can OpenGL help me here? How would I go about doing this? Creating a 2D rectangle and painting a texture of my raw data on it? I have all of my QGraphicsItems in a QGraphicsItemGroup, with them essentially making up one large image. If I am zoomed out far enough to see all of my hundreds of QGraphicsItems, the big "image" of the tiles is at least 32000x32000 pixels. Can OpenGL even handle that if I were mapping these as textures on rectangles?

1

1 Answers

0
votes

A texture 32000 square is 1Gpixel. With RGBA color, that's 4GB of video memory.

You said your dimensions are even more than that, so do you have enough video RAM? Don't forget to include space for mipmap levels.

You could probably speed this up with careful use of OpenGL, but you're going to need to manage textures intelligently and not expect OpenGL to create a texture that large.