How change background OUTSIDE application window in Android?
-
I create aplication for Android using QMainWindow. All works fine but if I run application on device with screen resolution greater than window has - outside this window clean white field appears. I did not find the way how change this color. Later I will make scaling window but now I need make this field black. Anybody knows how change color OUTSIDE application window?
Or just better - how make it transparent? On my Android tablet I use Calculator++. It can appear as small window in upper left screen corner. Not as applet but as window exactly. Other descktop part remains visible and responsible for taps. Can I get similar behaviuor in application based on QMainWindow?
-
I create aplication for Android using QMainWindow. All works fine but if I run application on device with screen resolution greater than window has - outside this window clean white field appears. I did not find the way how change this color. Later I will make scaling window but now I need make this field black. Anybody knows how change color OUTSIDE application window?
Or just better - how make it transparent? On my Android tablet I use Calculator++. It can appear as small window in upper left screen corner. Not as applet but as window exactly. Other descktop part remains visible and responsible for taps. Can I get similar behaviuor in application based on QMainWindow?
-
Adding of android:theme="@android:style/Theme.Translucent" to <activity...> tag in AdroidManifest.xml makes entire screen black. Including background of application "window". This looks much better than entire white screen. I can fill "window" background by any needed picture. Outside it screen will remain black. But I expected get transparent background outside "window" - I wanna see other application activity there. How can I do that?
By the way - this theme setting forces standrard controls on screen look "Androidish". For example progress bar appeared like default Android progress bar - grey strip on yellow background and without border. In QtDesigner I tuned it's look differently but all my settings were lost. Buttons look different too. I afraid if I will set skins for buttons - they will be lost with theme setting. How can I force controls look as I requested but use theme for just app background? In other words - How can I force controls skinning appear AFTER Android theme applied?
-
found it finally :D
u need to add add this
android:theme="@android:style/Theme.Translucent"
to <application...> section of AndroidManifest.xml.
then add this to your class:
this->setPalette(Qt::transparent);
source : https://bugreports.qt.io/browse/QTBUG-57394
thx @Gourmet a lot