I'm writing an app that could potentially have to render MILLIONS of items. I did a quick test, drawing exactly 1,000,000 items, and the app REALLY slowed down, and ate up quite a bit of memory (500MB according to Task Manager.) This is very bad, since I may have to potentially load data with multiple millions of items.
The thing is, these items I'm rendering are extremely simple-- a small filled square, the dimensions of which can range from 1px up to 20px, possibly more-- basically just scaled pixels. So I don't know if I necessarily need the overhead of QGraphicsView and/or QGraphicsItem, (I assume these classes are eating up all the memory) since rendering these squares will be very easy.
I need the memory usage to be as low as possible, but the app has to be fast. I was thinking of writing the boxes to a separate device context then blitting the whole thing at once to the render area.
Would I be able to do this manually? I'm going to need the ability to scroll and zoom, but I notice that QAbstractScrollArea doesn't have any scaling ability-- I suppose I'd have to implement that myself.
Does anyone have any suggestions?
Bookmarks