Qt for android: change the application icon
Asked Answered
U

5

15

How would I change the icon of Qt project targeted for android so that the launcher of application has this icon?

Unhinge answered 17/10, 2014 at 10:34 Comment(0)
F
15

You should create an Android manifest file and edit it in Qt Creator. Go to Projects > Build Android APK > Details

Now Select Create Templates to create the manifest file and to open it in editor :

enter image description here

As shown in the picture, you can set three versions of icons for your application with low, medium, and high DPI values, from left to right.

This new way of making an android manifest file is available since Qt 5.4 along Qt Creator 3.3. There used to be a Create AndroidManifest.xml button in Projects->Run->Deploy in previous versions.

Furfuraceous answered 28/1, 2015 at 7:10 Comment(4)
could you please tell what icon sizes have to be for all the three icons?Grooved
@Grooved Usually the standard size for low, medium and high are 36 x 36, 48 x 48 and 72 x 72 respectively.Furfuraceous
but this wouldn't be enough for 4K screens? or would it?Grooved
@Grooved Yeah it would not be enough for 4K. If you want to cover 4K, you should have larger icons for example 96 x 96, 144 x 144, 192 x 192. For low resolution displays they would be down-scaled by Android to match the expected size.Furfuraceous
M
1

Open Run settings of your project and select Create AndroidManifest.xml, then you'll be able to modify the manifest which should include stuff like the icon.

Refer to this:http://qt-project.org/doc/qtcreator-3.2/creator-deploying-android.html

Myrmidon answered 17/10, 2014 at 10:44 Comment(0)
S
1

Look at the this article about anatomy of a Qt 5 for Android application. You should attach to your project file AndroidManifest.xml, where you can define icon of application.

Snore answered 17/10, 2014 at 10:44 Comment(0)
S
1

I'm going to update this a bit: Using the AndroidManifest.xml, you can add android:icon="@mipmap/ic_launcherx" and android:roundIcon="@mipmap/ic_launcherx_round" to <application ... .

You can generate the icons simply in the android studio and add them to your project's android folder (ie: /android/res/[mipmap-hdpi]/[ic_launcherx.png] )

So this adds an icon and a rounded icon to the application. The interesting part, however, is the name; leaving the name @mipmap/ic_launcher will cause a "Error: Duplicate resource" ... So don't forget to change it. After that, a normal build should succeed =)

Selimah answered 10/6, 2019 at 6:14 Comment(0)
P
1

It is even more simplified in the QT Creator 4.12:

In the latest Qt Creator one is able to click on projects > Build > "Create Templates"

enter image description here

After that you can edit the Manifest as @Nejat explained:

enter image description here

Cheers!

Powerless answered 11/5, 2020 at 12:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.