Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57427

Cannot delete QOpenGLWidget after re-parenting to NULL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.5.1
    • GUI: OpenGL
    • None
    • Lubuntu 16.04

    Description

      When an QOpenGLWidget inheriting from QOpenGLFunctions_3_0 is re-parented to NULL, it causes a crash when it is deleted.

      I discovered that if widget contains a QOpenGLFunctions_3_0 object instead of inheriting from it, then there is no crash. Seems that deleting the inherited functions object is probably the real problem.

      Chris Kawa provided a workaround which is to show the QOpenGLWidget before deleting with show() or showMinimized(). He said: 'After you switch parents you need to show the widget again so that it has a surface to re-create the context on'

      Attachments

        1. main.cpp
          0.2 kB
        2. MainWindow.cpp
          0.5 kB
        3. MainWindow.h
          0.4 kB
        4. MainWindow.ui
          2 kB
        5. QTBUG-57427.tar.gz
          2 kB
        6. QtProblem
          0.6 kB
        7. QtProblem.pro
          0.4 kB
        8. QtProblem.pro.user
          23 kB
        9. TestGraphicsPane.h
          0.4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            elpidiovaldez5 elpidiovaldez5
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes