Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的应用程序使用 PyQt 并实例化一个QVTKOpenGLWidget. 当我的应用程序关闭时,我看到此错误出现在stderr:
QVTKOpenGLWidget
stderr
QGLContext::makeCurrent: Cannot make invalid context current
它似乎是无害的,但它看起来对我的用户来说很重要。我该如何预防?
我不确定错误的含义或导致错误的原因,但消除它的最简单方法是确保QVTKOpenGLWidget在关闭应用程序的其余部分之前将其销毁:
self.qvtk = QVTKOpenGLWidget() def delete_gl_widget(): self.qvtk.setParent(None) del self.qvtk QApplication.instance().aboutToQuit.connect( delete_gl_widget )