Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Scrollbars on a QGLWidget
Vit_H last edited by
I'm using a QGLWidget in my application, contained within a QScrollArea.
My QGLWidget subclass resizes itself in its constructor depending on the data I provide to it (usually larger than the size of the window); the QScrollArea was intended to keep the contents of the QGLWidget at the same zoom level regardless of the actual size of the widget. It worked fine in Qt 4.6, but updating to 4.7 seems to have broken it. The size of the QGLWidget's viewport seems to be fixed to the original size of the QScrollArea (i.e. the contents are shrunk and distorted), and the QScrollArea's scrollbars have no effect. The QGLWidget's viewport is fixed to the bottom-left of the QScrollArea.
Here are some screenshots showing the problem:
"Old screenshot using Qt 4.6, with the app working correctly":http://i54.tinypic.com/t88aoi.png
"Useless scroll bars in 4.7":http://i53.tinypic.com/33z8isl.png
"Resizing the window":http://i52.tinypic.com/11s2e10.png
I'm planning on recoding it from scratch anyway, but it would be very useful if I knew the cause of the problem and how to avoid it.