使用QT开发出的Android Apk安装后默认的图标是安卓的小机器人,下面介绍在QT5.12版本上修改APP名称和图标的方法。

1、  编译一次项目后,在编译目录下找到AndroidManifest.xml

2、  试试在项目目录下创建一个文件夹android_sources,把图标和 AndroidManifest.xml文件放进去

3、  右键项目,在弹出的菜单中选择“添加现有文件…”

4、  双击AndroidManifest.xml文件,在右侧进行修改,在"Application icon"处设置图标,这里有3种图标,分别为低、中、高。

5、  最后需要在.pro文件最后加一句,表示包含Android资源文件目录:

ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android_sources

再次编译生成,安装后显示:

以下是参考的内容:

First of all Create a Qt Widgets application project for Android. (if you don’t have Qt for Android installed on your computer then you can refer to this post on how to get it done!)

Next, without changing anything, just build the project. (You can run clean, qmake and then build which is what I always do to make sure things are alright.)

When you build a Qt project, a folder will be created by Qt to contain your build files. If you are using the default settings then this folder is located in the same folder where your project is located. It usually has a name similar to this: (Note that this is just an example and the folder name depends on the version and type of Qt build you are using but it has the same pattern)

build-myproject-Android_for_x86_GCC_4_9_Qt_5_5_0-Debug

如果你使用的是默认设置会在你工程的同级目录下(注意,这里的同级目录不是指你的pro文件所在的目录,而是包涵pro文件的那个文件夹所在的目录,即pro文件的上级目录),会出现类似于“build-myproject-Android_for_x86_GCC_4_9_Qt_5_5_0-Debug”这种名字的目录。

If you go to the build folder mentioned above, there is a folder named “android-build” inside it. Inside android-build you will find a file named AndroidManifest.xml, copy that file.

在上面的那个目录下会有一个“android-build”,在“android-build”这个目录下又有一个名字为“AndroidManifest.xml”的文件,现在我们复制这个文件。

Next, create a folder named “android-sources” inside your Qt project folder and copy AndroidManifest.xml there. (Note that your Qt project folder is the folder where your Qt PRO and source code CPP files etc. are located.)

下面,在工程文件所在目录(这里是pro文件所在的目录)下创建文件夹“android-sources”,将刚才的文件“AndroidManifest.xml”复制到这里。

Now right click your project in Qt Creator and select Add Existing Files. And select AndroidManifest.xml from the android-sources folder to add it to your project.

现在右键点击你Qt Creator中的工程,选择Add Existing Files(添加已存在的文件),将“AndroidManifest.xml”添加到工程中。如下图:

Note that you should have this in “Other files” section of your project.

Now it’s time to actually add the icon to your android application in Qt. Double click AndroidManifest.xml to open the following window in Qt Creator. It is actually Qt’s Android Manifest editor. At the middle of the screen there are three buttons which you can press and select an icon for each one of them. They are used for setting Low DPI, Medium DPI and High DPI icons.

现在双击Qt中的AndroidManifest.xml文件就打开如下界面,在"Application icon"处设置图标,这里有3种图标,分别为低、中、高。

Finally, open your Qt project (.PRO) file and append the following line at the bottom of it.

最后在工程文件.PRO文件中加上下面这名话。

ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources

Now if you run your Qt Android project you should see that the icon is changed!

现在再次build,图标就改变了。

关于程序名的更改也在AndroidManifest.xml中,就是把图标上面的“Application name”“Activity name”改了就可以了。

Qt for Android修改应用程序的图标和名称的更多相关文章

  1. Android 修改应用程序字体

    在网上搜索了相关资料,研究了两种算是比较快速的改变程序字体的方法,好,先来介绍着两种方法. 首先第一种方法是重写控件(以Textview为例): 1.Android在写程序的时候谷歌早已将所有字体都默 ...

  2. 创建一个QT for Android的传感器应用应用程序(摘自笔者2015年将出的《QT5权威指南》,本文为试读篇)

     这个手册描述了使用Qt Quick面访的方式在Android和ios设备上开发QtQuick应用程序的方法.我们使用Qt Creator实现一个QtQuick应用程序,这个应用程序基于加速器的值 ...

  3. 【Qt开发】更改应用程序图标和任务栏图标

    说明 实际开发过程中,生成的应用文件不会用默认的图标,同时程序启动后任务栏的图标也需要修改,还有窗口的图标,这样显得程序不那么low.更改程序的图标有多种方式,基于Qt Creator或vs开发的方式 ...

  4. 分享50款 Android 移动应用程序图标【下篇】

    在这个移动程序流行的时代,持续增长的应用程序经济充满了商业机遇.任何对应用程序设计感兴趣的人,将会喜欢上这里的50个独特的 Android 应用程序图标.这些例子中的图标能够让应用程序的设计更具吸引力 ...

  5. 分享50款 Android 移动应用程序图标【上篇】

    在这个移动程序流行的时代,持续增长的应用程序经济充满了商业机遇.任何对应用程序设计感兴趣的人,将会喜欢上这里的50个独特的 Android 应用程序图标.这些例子中的图标能够让应用程序的设计更具吸引力 ...

  6. Qt 程序运行图标

    Qt5 添加程序图标在pro直接添加一句: RC_ICONS+=resource\appicons\app.ico resource程序代码目录下文件夹. Qt4方式 1.在工程文件夹新建一个res目 ...

  7. Qt for Android 程序禁止屏幕旋转

    有时候我们希望让一个程序的界面始终保持在一个方向,不随手机(平板)方向旋转而变化:在AndroidManifest.xml的每一个需要禁止转向的Activity配置中加入 android:screen ...

  8. 如何在Ubuntu Unity上修改应用程序图标

    转自如何在Ubuntu Unity上修改应用程序图标 这篇文章将教大家在Ubuntu Unity上修改应用程序图标,这个教程适合于Ubuntu 14.04, Ubuntu 13.10, Ubuntu ...

  9. QT如何设置应用程序的图标

    QT如何设置应用程序的图标 准备:.ico格式的图片,可以选择任意其他图片格式的一张图片用格式工厂转换成.ico图片     例如选用的图片是Application.ico 把图片放到工程目录下 在工 ...

随机推荐

  1. 2015年第六届蓝桥杯C/C++程序设计本科B组决赛 ——居民集会(编程大题)

    标题:居民集会 蓝桥村的居民都生活在一条公路的边上,公路的长度为L,每户家庭的 位置都用这户家庭到公路的起点的距离来计算,第i户家庭距起点的距 离为di.每年,蓝桥村都要举行一次集会.今年,由于村里的 ...

  2. luoguP1198 [JSOI2008]最大数

    https://www.luogu.org/problem/P1198 update!!! 经过老师的讲解,惊人的发现这题有用更简单数据结构维护的解法,而越简单的数据结构(如果能够用的话),越好(实现 ...

  3. 201871010136-赵艳强《面向对象程序设计(java)》第六,七周学习总结

            201871010136-赵艳强<面向对象程序设计(java)>第六七周学习总结 项目 内容 这个作业属于哪个课程 <任课教师博客主页链接> https://w ...

  4. TCP数据报结构以及三次握手(九)

    TCP(Transmission Control Protocol,传输控制协议)是一种面向连接的.可靠的.基于字节流的通信协议,数据在传输前要建立连接,传输完毕后还要断开连接. 客户端在收发数据前要 ...

  5. shell 脚本 for,while,case 语句详解及案例

    ################for循环语句的结构#############使用for循环语句时,需要指定一个变量及可能的取值列表,针对每个不同的取值重复执行相同的命令序列,直到变量值用完退出循环. ...

  6. 日常歌颂zyj

    今年的中秋节... 我貌似遇到了一个灰常 灰常灰常优秀的 大哥哥~~ (貌似是条高二狗) 最开始在贴吧颓废... 然后... 开始逐条的回复... 开始去,,, 逐步查看,,, 发现这个优秀的楼主会 ...

  7. Docker 镜像/容器操作命令

    一.镜像操作   1.拉取镜像 # docker pull tomcat # docker pull tomcat:8.0.21-jre8 # docker pull 192.168.220.150: ...

  8. Swagger简单介绍

    一句话介绍 Swagger Swagger是一个接口文档生成工具,同时提供接口测试调用的辅助功能. 关于 Swagger Swagger能成为最受欢迎的REST APIs文档生成工具之一,有以下几个原 ...

  9. pyqt 调用QT设计师创建的对话框

    一.实验环境 1.Windows7x64_SP1 2.anaconda2.5.0 + python2.7(anaconda集成,不需单独安装) 3.pyinstaller3.0 二.实验步骤 2.1 ...

  10. [转帖]编写shell脚本所需的语法和示例

    编写shell脚本所需的语法和示例 https://blog.csdn.net/CSDN___LYY/article/details/100584638 在说什么是shell脚本之前,先说说什么是sh ...