Qt中opengl图像与QGraphicsIten叠加显示问题

qq_36123762 2019-07-23 08:46:16
QGraphicsView用setviewport设置opengl视口,下层opengl刷新显示nv12视频,上层绘制QGraphicsItem。
视频刷新显示时会吧QGraphicsItem覆盖,大神求解啊,,,,
...全文
265 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kelvin_Ngan 2021-06-23
  • 打赏
  • 举报
回复

参考Qt文档的https://doc.qt.io/qt-5/qopenglwidget.html 的Limitations,里面说了

Putting other widgets underneath and making the QOpenGLWidget transparent will not lead to the expected results: The widgets underneath will not be visible. This is because in practice the QOpenGLWidget is drawn before all other regular, non-OpenGL widgets, and so see-through type of solutions are not feasible. Other type of layouts, like having widgets on top of the QOpenGLWidget, will function as expected.

When absolutely necessary, this limitation can be overcome by setting the Qt::WA_AlwaysStackOnTop attribute on the QOpenGLWidget. Be aware however that this breaks stacking order, for example it will not be possible to have other widgets on top of the QOpenGLWidget, so it should only be used in situations where a semi-transparent QOpenGLWidget with other widgets visible underneath is required.

  • 打赏
  • 举报
回复
什么现象,上个代码,或者贴个图片看看呀,我之前遇到过在显示图像的窗口放的所有按钮等控件都会被画上小视频,哈哈

16,199

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧