您好,欢迎来到年旅网。
搜索
您的当前位置:首页QOpenGLWidget 全屏显示黑屏解决方案

QOpenGLWidget 全屏显示黑屏解决方案

来源:年旅网

一、碰到的问题:

用 QOpenGLWidget 显示YUV数据视频时,部分电脑设置全屏时会黑屏。

二、 

Fullscreen OpenGL Based Windows

When a window is using an OpenGL based surface and is appearing in full screen mode, problems can occur with other top-level windows which are part of the application. Due to limitations of the Windows DWM, compositing is not handled correctly for OpenGL based windows when going into full screen mode. As a result, other top-level windows are not placed on top of the full screen window when they are made visible. For example, menus may not appear correctly, or dialogs fail to show up.

A window can use an OpenGL based surface either explicitly when  is called, or when something that requires OpenGL is used inside the window, causing the whole window to be OpenGL based. For example,  or  can trigger this. However, if the surface is contained in a  which is hosted with , or the obsoleted QGLWidget is used and it does cover the entire full screen window, then this problem does not occur.

To solve this problem, a QWindowsWindowFunction can be used to enable a native Windows flag which will set WS_BORDER when showing in full screen mode. This can be utilized as follows:

  QWindowsWindowFunctions::setHasBorderInFullScreen(tlwWindow->windowHandle(), true);

This will give the full screen window a 1-pixel border, thus enabling the other top level windows to appear on top.

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- oldu.cn 版权所有 浙ICP备2024123271号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务