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

Bad QGLWidget when created on secondary screen

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0, 5.15.1
    • Fix Version/s: None
    • Component/s: GUI: OpenGL
    • Labels:
      None
    • Environment:
      Windows 10 2004, Visual Studio 2019, Qt 5.15.1 build from Git repo
    • Platform/s:
      Windows

      Description

      If a QGLWidget is part of a widget hierarchy that is created dynamically at runtime, the QGLWidget will be bad when the parent of the hierarchy is not on the primary screen.

      The bad QGLWidget will not fit into its surrounding widgets and positions returned by mouse events have an offset.

      The issue can be avoided with either

      • placing the parent widget on the primary screen before creating the widget hierarchy or
      • passing an already visible widget as parent in the QGLWidget constructor and use setParent() afterwards to assign the correct parent

      The root cause seems to lie deep in the Qt internals, maybe in WindowCreationData::create().

      I attach the source of an example program to reproduce the error, plus some additional information in the .7z file.

      Reference: INC-1511632 (related)

      Error is visible especially in the lower right corner of the QGLWidget.

        Attachments

        1. Bad QGLWidget.png
          Bad QGLWidget.png
          17 kB
        2. Good QGLWidget.png
          Good QGLWidget.png
          20 kB
        3. QGLWidgetTest.7z
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            r.wiesenfarth Rainer Wiesenfarth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes