简体   繁体   中英

QGLWidget maximum size

I have a Qt application using OpenGL drawing with QGLWidget , on Mac OS. On my MBP it works well, but when trying on a 30" screen, I noticed that there is a window size limit.
If I increase the window size beyond a certain limit, the QGLWidget 's content disappears and only some greyish memory junk is visible.

I changed the code to only put a QGLWidget on the screen. The repaint event is setting the background black in each iteration.
The issue is still visible: when resizing the widget, the black surface disappears and gets replaced by the memory junk, when the size of the widget reaches a certain size.

Interesting facts:

  • When I decrease the window size, the GL surface comes back to live again
  • I have several other GL applications (not Qt) running in maximized window, so the issue is not with the OpenGL driver/video card
  • It seems that the area of the window (nr of pixels) matters, if I make the window very wide, it's height will be limited and vica versa, I if the windoe is maximized in height, the width must be small

我发现,虽然实例化QGLWidget使用QGLFormat(QGL::NoSampleBuffers)而不是QGLFormat(QGL::SampleBuffers)解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM