Qt 5.2 QWidget/QGLWidget setParent error?



  • Hi,

    When I do setParent for a QGLWidget in Qt5.2 the context of the widget is destroyed. Until that point the widget works correctly and draws everything as it should, and when I set the parent this is the call stack I get where the context is destroyed:

    Qt5OpenGLd.dll!QGLContext::reset() Line 203 C++ Qt5OpenGLd.dll!QGLWidgetPrivate::aboutToDestroy() Line 148 C++ Qt5Widgetsd.dll!QWidget::destroy(bool destroyWindow, bool destroySubWindows) Line 179 C++ Qt5Widgetsd.dll!QWidget::destroy(bool destroyWindow, bool destroySubWindows) Line 205 C++ Qt5Widgetsd.dll!QWidget::destroy(bool destroyWindow, bool destroySubWindows) Line 205 C++ > Qt5Widgetsd.dll!QWidgetPrivate::setParent_sys(QWidget * newparent, QFlags<enum Qt::WindowType> f) Line 277 C++ Qt5Widgetsd.dll!QWidget::setParent(QWidget * parent, QFlags<enum Qt::WindowType> f) Line 9641 C++ Qt5Widgetsd.dll!QWidget::setParent(QWidget * parent) Line 9587 C++

    I don't see any reason why the context should be destroyed when I set the parent, and there is no simple way to create a new context.
    Any idea how I can work around this problem?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.