Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.0
-
None
-
Android 6, Android 7 and Android 8 on different tablets, build on Windows 10 with Qt 5.15
Description
I have tried in several ways to give a widget a semi-transparent background in android. Unfortunately I only got to the success via a workaround. With these variants I have tried to create a semi transparent background:
Flags:
- WA_TranslucentBackground is used to give the widget a alpha channel
- WindowFlag Qt::FramelessWindowHint needed in every version for windows otherwise there is no WA_TranslucentBackground used
- version 1 - semit transparent background in stylesheet
-> windows: popup background is transparent
-> android: popup background is black - version 2 - semit transparent background in stylesheet - without WA_TranslucentBackground flag (widget has no alpha channed)
-> windows: popup background is green without any transparency
-> android: popup background is green without any transparency - version 3 - set palette (like in: https://bugreports.qt.io/browse/QTBUG-43635)
-> windows: popup background is transparent
-> android: popup background is black - version 4 - set palette (like in: https://bugreports.qt.io/browse/QTBUG-43635) - without WA_TranslucentBackground flag (widget has no alpha channed)
-> windows: popup background is green without any transparency
-> android: popup background is green without any transparency - version 5 - use paint event and WA_TranslucentBackground
-> windows: popup background is semi transparent green hurray
-> android: popup background is green without any transparency - version 6 - use paint event and WA_TranslucentBackground and a empty QQuickWidget in mainWindow
-> windows: popup background is semi transparent green hurray
-> android: popup background is semi transparent green hurray
So as you can see I can only generate a semi transparent background on android if I use a QQuickWidget in the mainWindow.
I would happy if someone can have a look into this issue and tell us how we can create such widgets without a QuickWidget inside the parent.
I attached the reproducible project with all variations from above - just uncomment the version you want to see.