Actually, I have figured out that there is a problem about the viewport's size when using QMainWindow.

I have created a QMainWindow with a QMenuBar and a QGraphicsView on the central part of the QMainWindow.

When the QMenuBar is created and the `setMenuBar()` method of QMainWindow is called, the size of the resulting viewport of the view is not the same as the viewport's size (there is a 20-30 pixels difference). But if `setMenuBar()` method is not called, everything works just fine.