QGLWidget 的问题
我的 QGLWidget 有问题。实际上,通过鼠标操作,QGLWidget 将会更新。我需要从此小部件打开另一个窗口,例如使用双击事件。我正在创建一个新的小部件 QWidget,以 QGLWidget 作为父级,并将以下标志设置到新窗口。
QWidget::setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
这个新窗口打开良好,按预期工作。但是当我关闭这个窗口并尝试更新 QGLWidget 时,它的表现很奇怪。整个 QGLWidget 的一小部分(新窗口打开的区域)正在更新,但不是整个 QGLWidget。
另外,错过了在这里更新另一点。这个问题并不是每次都会发生。 qt 应用程序用另一个应用程序打开,并使用所需的 dll 重新分发。作为独立应用程序打开时没有问题。但当用其他应用程序打开时,问题又出现了。
有什么想法吗?
谢谢你!!
I have a problem with QGLWidget. Actually, with the mouse actions, the QGLWidget will get updated. I have a requirement to open another window from this widget, for example with a double click event. I am creating a new widget QWidget with QGLWidget as parent and setting the following flags to the new window.
QWidget::setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
This new window opens up fine, working as expected. But when I close this window and try to update the QGLWidget, its acting weird. The small part of the total QGLWidget(the area where the new window has opened), is getting updated but not the entire QGLWidget.
Also, missed to update another point here. This issue is not happening every time. The qt application is opened with another application, redistributed with required dlls. When opened as an independent application, it has no problem. But when opened with other application, the problem resurfaces.
Any ideas why?
Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我按照你所说的做了一个快速的 Qt 应用程序,但没有看到这个问题。子窗口小部件照常显示。如果我将其移开或关闭,我会看到其下方的 GL 场景。也许您可以提供一段代码或问题的屏幕截图。
然而,听起来你的 GL 窗口正在以某种方式更新,其画家限制在特定区域,如
I tossed together a quick Qt app doing what you say and didn't see this problem. The child widget displays as usual. If I move it out of the way or close it, I see the GL scene beneath it. Perhaps you could provide a snippet of code, or a screen shot of the problem.
However, it sounds like somehow your GL window is getting updated with its painter restricted to a specific area as described here.