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

Mac: Wrong positioning of sheet when setUnifiedTitleAndToolBarOnMac is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.3
    • QPA
    • None
    • macOS

    Description

      • 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.

      Attachments

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

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dbutijn David Butijn
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: