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

QOpenGLWidget mess up with app layout/pixel ratio on Retina screens

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.0 RC, 5.14, 5.15
    • 5.4.0 Beta
    • GUI: OpenGL
    • None
    • OSX 10.9, XCode 5, qt-opensource-mac-x64-clang-5.4.0-beta_2014-10-03_13-59-21-26.dmg
    • a7f1eb4ab35a74e401c41d77e5fad13193c25c56 444e947aadc82e2aeb72fa5b3e6a352ff02441f2

    Description

      Adding a QOpenGLWidget to an application on a Retina screen blows the layout/pixel ratio of the entire application.
      Simplest repro: build and run the QOpenGLWidget example from the SDK.

      The app layout/pixel ratio is messed up as soon as:
      -you add a QOpenGLWidget to the main window layout
      -or you have a QOpenGLWidget created with the main window as the parent

      Screenshots provided:
      -QOpenGLWidget example running on a non-retina screen
      -QOpenGLWidget example running on a retina screen
      -QOpenGLWidget example running on a retina screen, and the QOpenGLWidget is not added to the layout
      (done by commenting the line m_layout->addWidget(glwidget,1,0,8,1)

      I have the exact same problem on my own application.
      Looks like the application is stretched x2 from the bottom left.

      You can enable HiDPI on any OSX>=10.7 using the following command line:
      sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true
      The additional resolutions then appear in the display settings

      Here's the GPU detail:
      GPU: Apple Computer, Inc. / Apple Software Renderer
      OGL: 2.1 APPLE-9.0.83 / 1.20

      Attachments

        1. about_mac.png
          about_mac.png
          275 kB
        2. display.png
          display.png
          167 kB
        3. graphics_info.png
          graphics_info.png
          501 kB
        4. hellogl2_QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE.png
          hellogl2_QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE.png
          736 kB
        5. hellogl2_retina.png
          hellogl2_retina.png
          681 kB
        6. qopenglwidget-noretina.jpg
          qopenglwidget-noretina.jpg
          165 kB
        7. qopenglwidget-retina.jpg
          qopenglwidget-retina.jpg
          359 kB
        8. qopenglwidget-retina-nowidget.jpg
          qopenglwidget-retina-nowidget.jpg
          322 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            divide Robin Lobel
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes