-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.2
-
None
It seems that the bottom and top margins of pages behave in non-predictable ways causing part of the screen to hide under the status bar at the top or the navigation bar at the bottom on Android. This happens on some devices, at random it seems.
Recently I upgraded my app to target Android 15 which causes apps to use the full screen. I was using Qt6.8.3 at the time. To make sure that pages in my app show in the space between the status and navigation bars, I added empty items at the top and bottom of my pages (sometimes rectangles, sometimes extra margins in my headers and footers, depending on the controls). To make sure that my app works properly on older Android versions I added this Java code to my main activity:
// Enable EdgeToEdge mode, i.e. full screen. WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
It all worked fine.
Recently I upgraded to Q6.9.2. Off course with the changed logic for margins and SafeArea, it did not work fine anymore. To make my app work again I added this to my ApplicationWindow in Main.qml:
topPadding: 0 bottomPadding: 0 leftPadding: 0 rightPadding: 0
All other pages are children of this ApplicationWindow.
On my Samsung Galaxy phone and the emulator (Google Pixel) all worked fine again.
However, I got several complaints from users:
- On Motorola and OnePlus devices, pages sometimes had a lot of empty space at the top such that the bottom hides under the Android navigation bar. Sometime the empty space was at the bottom making the top hide under the status bar.
- On Samsung tablets using Dex the top of my app got hidden under the Dex title bar.
To fix this I tried setting the flag Qt::ExpandedClientAreaHint
This did not fix the issues, and it made behavior on tablets worse. If a tablet was using split mode, then the width and height from the Application still gave the full screen geometry causing only half of my app being visible.
I downgraded to Qt6.8.3 and all these problems are gone. So I believe these issues to be caused by Qt6.9.*
Unfortunately I cannot do much debugging as on my Samsung phone I do not see these problems.