简体   繁体   English

QGLWidget最大尺寸

[英]QGLWidget maximum size

I have a Qt application using OpenGL drawing with QGLWidget , on Mac OS. 我在Mac OS上有一个使用OpenGL绘图和QGLWidget的Qt应用程序。 On my MBP it works well, but when trying on a 30" screen, I noticed that there is a window size limit. 在我的MBP上,它可以很好地运行,但是在30英寸的屏幕上尝试时,我注意到有一个窗口大小限制。
If I increase the window size beyond a certain limit, the QGLWidget 's content disappears and only some greyish memory junk is visible. 如果我将窗口大小增加到某个限制之外,则QGLWidget的内容将消失,并且只能看到一些灰色的内存垃圾。

I changed the code to only put a QGLWidget on the screen. 我将代码更改为仅在屏幕上放置QGLWidget The repaint event is setting the background black in each iteration. repaint event在每次迭代中将背景设置为黑色。
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 当我减小窗口大小时,GL表面又恢复了原状
  • I have several other GL applications (not Qt) running in maximized window, so the issue is not with the OpenGL driver/video card 我还有其他几个GL应用程序(不是Qt)在最大化窗口中运行,因此问题不在于OpenGL驱动程序/视频卡
  • 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 似乎窗口的面积(像素nr)很重要,如果我使窗口非常宽,则其高度将受到限制,反之亦然,如果将风窗的高度最大化,则宽度必须很小

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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