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

Main window crashes/black out when QtDataVisualization 3D chart in QMdiSubWindow destroyed

    XMLWordPrintable

Details

    • Windows
    • 5e83def8f (dev), 3d7ce7533 (6.8), 21b6890e6 (tqtc/lts-6.5)

    Description

      A comercial user reported an issue as follows:


      Our main window uses QOpenGLWindow to render and we have a dialog that the user can use to create 2D/3D Charts that are rendered through QMdiSubWindows.
      However, when removing a 3D chart the main window crashes, or in some cases goes entirely black. I've reproduced this behaviour in the example attached.
      I built the example with Qt Creator 13.0.1, MSVC 2019, and the Qt version I am using is 6.5.6. 
      To reproduce:

      • Build with debug/release and launch
      • Click on 'Open MDI Dialog' button
      • Take focus away from the dialog by clicking on the main window
      • Close the QMdiSubWindow by clicking on the close button in the top right
      • Click back on the main window and the entire window goes black.

      I found a similar issue posted on the Qt forums a while ago so it appears that the problem has existed for a while - https://forum.qt.io/topic/77345/qmainwindow-s-content-turns-black-after-qmdisubwindow-closes?_=1676384471167

      It's hard to pinpoint what the issue is as any debugger does not tell me any useful information, but it appears that when there are two widgets using OpenGL such as the QOpenGLWidget and Q3DSurface in this case, when the Q3DSurface is destroyed it no longer draws anything for the parent main window either.

      I've not been able to check the new Qt Graphs module to see if it will still be an issue if we migrated away from Qt Data Visualization, so would be interesting to see if migrating to Qt Graphs fixes that.

      Further, one workaround is to remove the 'subWindow->setAttribute(Qt::WA_DeleteOnClose, true);' line from the MdiDialog constructor, however this means any deleted charts are stored in memory until the application closes in its entirety, so this can be expensive if many charts are created.


      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            spouke Sakaria Pouke
            hitoshiito Hitoshi Ito
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes