Quote Originally Posted by macbeth View Post
When drawing small rectangles (4x4 pixels), it is quite fast (250 000 rects/6sec), but then I tried to draw 250 000 rects, each 200x200 pixels large, and it took almost 15(!) minutes to complete this task... (same code and image size, just increased rects sizes)
250 000 of 4x4 rects gives 4 000 000 pixels to draw.
250 000 of 200x200 rects gives 10 000 000 000 pixels.

It has to take a lot of time to draw it, unless you reduce the number of rectangles (for example by throwing away the occluded ones).

Try this on your computer:
Qt Code:
  1. int main()
  2. {
  3. for( long long i = 0; i < 10000000000; ++i );
  4. return 0;
  5. }
To copy to clipboard, switch view to plain text mode 
$ time ./a.out

real 0m30.870s
user 0m30.698s
sys 0m0.140s
(just don't cheat by turning on the optimization).
It takes 30 seconds on my computer just to count from 0 to 999 999 999 --- without any function calls or data manipulation.

Quote Originally Posted by macbeth View Post
Does anybody know, what is GraphicsView doing in the background? Still updating the view?
I'm quite disappointed, because they say in Qt docs:[...]
BSP won't speed up the drawing, it only speeds up the selection of items that have to be drawn. If you have milions of items and only 1% of them is visible, GraphicsView will do its job, if you want to show all of them at once --- it won't help you.

With such large amount of items, you should rather paint on a pixmap and store that pximap in the memory instead of particular items. You can also use a second thread that will do the drawing (in such case you will need a QImage) and the GUI thread would only display the updated pixmaps.