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

SafeArea margins not populated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0 RC
    • Quick: Controls 2
    • None
    • Motorola Razr 40 Ultra, Android 15
      Samsung Galaxy Tab A9, Android 14
    • Android

    Description

      This behavior has been observed on 6.9.0 RC, downloaded from Qt Maintenance Tool, and also upstream Qt pulled on 27.03.2025.

      When running the minimal reproducer, SafeArea.margins report 0 on all sides, regardless of the window-flags being set.

      On the Motorola Razr 40 Ultra, Android 15, the window is extended to fill the display only on the main display. On the smaller flip-display, the window does not extend all the way to the bottom of the display, like other apps do. During testing, SafeArea.margins returns 0 even if you turn on/off the Qt.ExpandedClientAreaHint flag.

      On the Samsung Galaxy Tab A9, Android 14, the window is extended to fill the display correctly when the Qt.ExpandedClientAreaHint flag is applied, and not extended when the flag is not applied. This is expected. In both of the configurations, SafeArea.margins returns 0.

      The reproducer used (and attached below) is the following:

      import QtQuick
      import QtQuick.Controls
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")    flags: Qt.ExpandedClientAreaHint | Qt.NoTitleBarBackgroundHint    
      
          Component.onCompleted: {
              console.log(SafeArea.margins.top)
              console.log(SafeArea.margins.left)
              console.log(SafeArea.margins.right)
              console.log(SafeArea.margins.bottom)
          }    
      
          Label {
              text: "Sample text"
              x: parent.SafeArea.margins.left
              y: parent.SafeArea.margins.top
          }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-135283
        # Subject Branch Project Status CR V

        Activity

          People

            assam Assam Boudjelthia
            npskalerud Nils Petter Skålerud
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change