Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.0
-
Qt 6.9, QtC 16.0.0
-
-
2025wk18s1QtforAndroid, 2025wk20s1QtforAndroid
Description
Added Example App
see example1.txt
slightly modified from vestbo
https://gist.github.com/torarnv/6923a4ae199d44b5763060be3c00d169
added a button to toggle between Dark and White
and displaying SafeArea values
Application.styleHints.colorScheme = Qt.ColorScheme.Dark
darkGreen ToolBar with white text
-------
Android
Starting the app directly from the device two workflows are happening:
A) usually, but not always:
no SafeArea values available, so StatusBar and ToolBar overlapping
see image A1_statusbar_overlapped.png
manually rotating from Portrait to Landscape and back, the SafeArea values are coming in and ToolBar is positioned below StatusBar.
Also colors are correct: Toolbar and StatusBar white
see image A2_statusbar_rotated_and_back.png
Toggling the color between dark and light works for the Toolbar, but StatusBar always remains white text
B) sometimes SafeArea values are available directly after starting the app, but in this case, ToolBar was with white text (correct) and StatusBar with black text (faulty).
Toggling the color between darkgreen and lightgray works for the ToolBar, but StatusBar always remains with black text in this case
see image B_statusbar_black.png
-------
Android
running from QtCreator
C) Now we're getting StatusBar with black text-color (wrong).
see image C1_statusbar_wrong.png
Manually rotating into Landscape and back gives correct white text-color in StatusBar
see image C2_statusbar_ok.png
Toggling color doesn't work
BTW: while trying to use it together with QtQuick.Controls.Material, sometimes StatusBar and ToolBar overlap also running from QtC
-------
iOS
no different behavior between starting from device or QtCreator
no problems with themes/colors using example1
can switch between Dark and Light without any problems, colors of ToolBar and StatusBar always as expected.
but there are problems with SafeArea.margins Left and Right, on iOS both always have same values
iPhone XR, iOS 17.5.1
Portrait:
SafeArea Top: 48, Left: 0, Right: 0, Bottom: 34
OK
Rotate from Portrait into Landscape:
SafeArea Top: 0, Left: 48, Right: 48, Bottom: 21
WRONG - should be:
SafeArea Top: 0, Left: 0, Right: 48, Bottom: 21
or
SafeArea Top: 0, Left: 48, Right: 0, Bottom: 21
-------
Question Light vs Dark Themes
In my Android and iOS Apps I'm using QtQuick.Controls.Material, usually with Material.Light theme. The ToolBar Background comes from Material.primary color.
This works with 6.9.0 Expanded Client Areas.
ToolBar and StatusBar both have same background color.
This is OK for me.
On iOS using Dark and Light Themes to set black or white StatusBar-text-color already works, so hopefully on Android in 6.9.1 ?
The theme for 6.9.0 Expanded Client Areas is set by Application.styleHints.colorScheme = Qt.ColorScheme.Dark / Light - so at application level.
Hopefully there will be no collision when Material.Light is used from my apps together with a dark colorized ToolBar/StatusBar.
Currently I'm using MobileUI (https://github.com/emericg/MobileUI) from Emeric Grange, where I can set explicitly statusbarTheme: MobileUI.Dark (or Light)
Attachments
Issue Links
- relates to
-
QTBUG-136591 Window{} visibility does not work properly with CMake command QT_ANDROID_TARGET_SDK_VERSION 35
-
- Closed
-