Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Holo theme in Qt Android application

I have a Qt Android application, and I want to set its theme to be Holo (i.e. the dark variant, not Holo Light). Here's a comparison between Holo Dark theme (left), and how my application looks now (right):

enter image description hereenter image description here

I'm using Qt 5.2.0, and I'm using Qt/C++ (i.e. not QML), but I'm interested for any way that works, regardless of Qt version or whether it's QML or C++.

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

like image 655
sashoalm Avatar asked Jan 12 '14 20:01

sashoalm


1 Answers

Edit: Holo Dark can now be selected as of 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 phone's default theme no matter 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 available for the moment for QtQuickControls, although it was brought to Qt 5.2 for the QtWidgets.

The former is on BogDan's TODO list for 5.3. See his blog for details:

Qt on Android Episode 1

Here you can find a couple of screenshots from my friend's system.

Non-native

enter image description here

Native

enter image description here

QtCreator

enter image description here

like image 160
lpapp Avatar answered Oct 14 '22 22:10

lpapp