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. How to create QGLWidget context after re-parenting it (only since moved to 5.2)?
Forum Updated to NodeBB v4.3 + New Features

How to create QGLWidget context after re-parenting it (only since moved to 5.2)?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 525 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

    I create a 2 QGLWidget windows. They are working fine until I set parent to one of them.
    For some reason Qt has the following stack when doing that:

    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++

    And eventually destroys my context which I find strange since I only set the parent of the widget.
    From the programmer point of view, this is a bug. you do not expect this kind of behavior. my widget is working, I set the parent and it stops working.
    Now that I know that this is a problem, how do I create a new context?
    there is no real function "Create new context"
    And the old "setContext" is deprecated

    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