使用全息主题Qt的Android应用程序 [英] Use Holo theme in Qt Android application
问题描述
我有一个Qt的Android应用程序,我想设置的主题是霍洛(即暗变型,而不是全息光)。这里的全息黑暗的主题(左),和我的应用程序现在的外观(右)之间的比较:
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):
我使用Qt 5.2.0,而我使用Qt / C ++(即不QML),但我感兴趣的任何作品的Qt版本,无论还是它的QML或C ++的方式。
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++.
编辑:我知道,使用部长,它会创建像素图使用的原生的主题所有的部件,但有可能告诉部长 要使用的主题?
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?
推荐答案
编辑:全息暗现在可以通过添加 Android的选择的Qt 5.4:主题=@机器人:款式/ Theme.Holo
到<应用>
在AndroidManifest.xml中
Holo Dark can now be selected as of Qt 5.4 by adding android:theme="@android:style/Theme.Holo"
to <application>
in AndroidManifest.xml.
这工作了Qt 5.4,但不使用Qt 5.2,使用Qt 5.2,主题始终是手机的默认主题,无论你的安卓指定的内容:主题
的清单中。
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.
因此,在AndroidManifest.xml中,找到&lt;应用&GT;
节点,将其更改为:
So in AndroidManifest.xml, find the <application>
node, and change it to:
<application android:theme="@android:style/Theme.Holo" ...
这是不可用的时刻QtQuickControls,虽然它被带到的Qt 5.2为QtWidgets。
This is not available for the moment for QtQuickControls, although it was brought to Qt 5.2 for the QtWidgets.
,前者是波格丹的TODO列表5.3。看他的博客的详细信息:
The former is on BogDan's TODO list for 5.3. See his blog for details:
在这里你可以找到一对夫妇的截图,从我的朋友的系统。
Here you can find a couple of screenshots from my friend's system.
这篇关于使用全息主题Qt的Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!