Using Holo Theme in Qt Android App

I have a Qt Android app and I want its theme to be Holo (i.e. the dark version, not Holo Light). This compares the Holo Dark theme (left) and what my app looks like (right):

enter image description hereenter image description here

I use Qt 5.2.0 and I use Qt / C ++ (i.e. not QML), but I'm interested in any way that works regardless of the version of Qt or QML or C ++.

Edit: I know that with Ministro it will create pixmaps for all widgets using a "native" theme, but is it possible to tell Ministro which theme to use

+6
source share
3 answers

Edit: Now Holo Dark can now be selected with Qt 5.4 by adding android:theme="@android:style/Theme.Holo" to <application> in AndroidManifest.xml.

This works with Qt 5.4, but not with Qt 5.2, with Qt 5.2, the theme is always the default theme for the phone, regardless of what you specify for android:theme in the manifest.

So, in AndroidManifest.xml, find the <application> node and change it to:

 <application android:theme="@android:style/Theme.Holo" ... 

This is not currently available for QtQuickControls, although it has been ported to Qt 5.2 for QtWidgets.

The first is on the BogDan TODO list for 5.3. See his blog for more details:

Qt on Android Episode 1

Here you can find some screenshots from my friends system.

nonlocal

enter image description here

Native

enter image description here

QtCreator

enter image description here

+3
source

Boo, using Ministro, your application gets dependent on the Ministro application. I think this is a drawback, because an additional dependency will cause the application to check at startup if Ministro is installed on your device yes or no. If it is not installed, the user is forced to install it through the Android Play Store.

Instead of using Ministro, I would install a custom style sheet that mimics a holographic theme.

QApplication::setStyleSheet(const QString & sheet)

There is a GIT repository here that mimics various themes for Android. You should not try to adapt the .css hologram file to the Qt table file (.qss).

+1
source

According to the Google Style Guide, you need to install it in AndroidManifest.xml:

To set a theme for all the actions of your application, open the AndroidManifest.xml file and edit the tag to include the android: theme attribute with the style name. For instance:

  <application android:theme="@android:style/Theme.Holo"/> 

If you need a light theme (it is dark by default), you should write this instead:

  <application android:theme="@android:style/Theme.Holo.Light"/> 
0
source

All Articles