[英]Qt objects under OpenGL viewport
I have just read here that "Qt transparent windows over an OpenGL viewport" : 我刚刚在这里读到“在OpenGL视口上的Qt透明窗口”:
But if I try to add some widgets (let's say a checkbox) over a frame, and via code, add a QGLWidget to this frame.. it does not render the widget. 但是,如果我尝试在框架上添加一些小部件(例如复选框),并通过代码将QGLWidget添加到此框架..它不会呈现该小部件。
How to achieve this effect? 如何达到这个效果? possibly keeping on using Qt Designer.
可能会继续使用Qt Designer。
EDIT: due to the comment I have to specify that the problem I am experiencing is that every kind of widgdet OVER a QGLWidget seems not to be rendered anymore (because of some opengl context black magic?) 编辑:由于评论,我必须指定我遇到的问题是,在QGLWidget上的每种widgdet似乎都不再呈现(由于一些opengl上下文黑魔法?)
There's a good piece in the Qt Quarterly about how to do it: QQ: Accelerate Your Widgets With OpenGL . 《 Qt季刊》上有一篇很好的介绍: QQ:使用OpenGL加速小部件 。 It does entail some large changes to move away from
QGLWidget
, but it seems reasonably straightforward to implement. 它确实需要进行一些较大的更改才能脱离
QGLWidget
,但是实现起来似乎相当简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.