Oopps, I'm a bit dizzy late at night. I've produced a minimal example and figured out that the problem is with the line:

Qt Code:
  1. self.setCacheMode(QGraphicsView.CacheBackground)
To copy to clipboard, switch view to plain text mode 

Removing it solved the problem. I just tought it could speed up the performance of drawing grid.

Thank you for your help.