Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.2 QWidget/QGLWidget setParent error?
Forum Updated to NodeBB v4.3 + New Features

Qt 5.2 QWidget/QGLWidget setParent error?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 990 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ycyclop
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved