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

QOpenGLWindow in widget container disappears randomly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2, 6.5
    • None
    • M1 macOS 13.6.7
      M1 macOS 14.4.1
      Intel macOS 12.7.2
    • macOS

    Description

      I have been chasing down a bug in our application for a while.

      We used to use several QOpenGLWidgets in different workspaces within our application.

      We recently changed over to using QOpenGLWindow and embedding them with widget containers, for performance.

      This has worked well, in general.

      However, on macOS sometimes these QOpenGLWindow views just disappear, and you see whatever is underneath them instead. If you do something that triggers a repaint, the QOpenGLWindow content comes back.

      I couldn't find any events in the program for repaint/update/anything that corresponded to when the QOpenGLWindow content would disappear.

      Through some profiling I found that QFontCache::decreaseCache() and ~QCoreTextFontEngine() were called at the time the content disappeared. And even though it seems crazy (to me), this is somehow causing the issue.

      If I exit early from QFontCache::decreaseCache, the issue doesn't happen. Or if I avoid drawing text in the QOpenGLWindow, the issue doesn't happen.

      I have attached a minimal working sample that duplicates the issue. It creates two QOpenGLWindows and embeds them in a bigger view.

      The QOpenGLWindow subclass draws text in several different fonts. This is necessary in order to trigger the font unloading that causes the issue.

      If you run the program, the lower QOpenGLWindow will disappear in less than a minute. If you resize the window, it will appear again.

       

      Attachments

        1. Screenshot 2024-05-23 at 1.26.18 PM.png
          407 kB
          Dyami Caliri
        2. Screenshot 2024-05-23 at 1.26.34 PM.png
          381 kB
          Dyami Caliri
        3. WindowContainerBug.zip
          10 kB
          Dyami Caliri
        4. WindowContainerBug2.zip
          8 kB
          Dyami Caliri
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            dzedsystems Dyami Caliri
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes