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

Mac: Wrong positioning of sheet when setUnifiedTitleAndToolBarOnMac is used



    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.3
    • Fix Version/s: None
    • Component/s: QPA
    • Labels:
    • Environment:
    • Platform/s:


      • Create a QMainWindow
      • Call setUnifiedTitleAndToolBarOnMac(true) on this window
      • Show a sheet

      I expect the sheet to be shown under the titlebar, but instead it is positioned too high covering the titlebar.

      In attachment you'll find a working example. If you compile this with 5.9.3 you will see the bug. I tested also with 5.6.0 and there we don't have the bug. So it's a regression. On the screenshot you see the version compiled with 5.9.3 on the left and the one which is build with 5.6.0 on the right.


      I think this issue is introduced with https://codereview.qt-project.org/#/c/208117/ which was the fix for QTBUG-63444.

      When setting 'titlebarAppearsTransparent' to YES, you have to add the height of the titlebar yourself to the thickness of the contentBorder.

      I added

      effectiveTopContentBorderThickness += frameMargins().top();

      just at the place where titlebarAppearsTransparent is set to YES and this solved the issue.


        1. Toolbar.png
          27 kB
          David Butijn
        2. Toolbar.zip
          2 kB
          David Butijn

          Issue Links

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



              • Assignee:
                qt.team.graphics.and.multimedia Qt Graphics and Multimedia Team
                dbutijn David Butijn
              • Votes:
                2 Vote for this issue
                4 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes