I have tried to port the OCC bottle example (samples/qt/tutorial) to Qt 5.4. Since there is no QWorkspace anymore, I have replaced it by QMdiArea. The windows for a document (in the sample called MDIWindow) inherit from QMainWindow (then I can add a tool bar). I add them to the QMdiArea with addSubWindow(QWidget*).
The code works quite fine, but I have a problem with maximizing these document windows. When I change their size by clicking onto the frame and dragging the frame, the 3D view (the OpenGL view) resizes perfectly. But when I maximize the document window (by clicking onto the maximize frame button), the resizeEvent method of my QWidget containing the 3D view is called, but the 3D view covers only a small part of the actual window (actually exactly the area defined by "QSize sizeHint();" - see screenshot). When I maximize the application window instead, the 3D view is correctly resized.
The only difference I was able to find, is the order of resize events. When the document window (MDIWindow) receives the resize event first and the widget containing the V3d_View (in the sample called View) receives the resize event later, then the 3D view is not correctly displayed. This happens when maximizing or unmaximizing the document window (MDIWindow). When I manually resize the document window or I maximize/unmaximize the application window (where the document window is maximal), then first the View widget receives the resize event and later the document window. In this case the 3D view is correctly displayed afterwards.
Has anyone ported the bottle example to Qt 5? Did you also have resizing troubles? How can they be solved?
Could there be a problem with the order of resize events? Can I define Qt event orders?
Thank you for any help!