Qt4 设置应用程序图标

  1. 将一个ico图标放在资源文件夹下;
  2. 然后建立txt,输入 IDI_ICON1 DISCARABLE “myico.ico”;
  3. 保存文件,将其后缀改为.rc;
  4. 然后,在项目目录pro的文件里加入 RC_FILE += myico.rc;

直接运行程序,这样MainWindows窗口图标的左上角的图标和debug里面的可执行程序的图标就变了。我的天啊,这是要累死人的节奏.

2016_09_03更新

Qt5 Win 设置应用程序图标

  1. 将一个ico图标放在资源文件夹下,假设取名:myApp.ico
  2. pro的文件里加入 RC_ICONS = myiApp.ico;

直接运行程序,这样MainWindows窗口图标的左上角的图标和debug里面的可执行程序的图标就变了。我的天啊,步骤少了一半儿啊.

2017_10_11 update

Qt5 Mac Setting Application Icon

Qt Help manual hot key Setting Application Icon include win,mac,linux.

In Mac,

  1. Download ico file;
  2. Using Mac App tool IconKit to create all size icon files in app.iconset folder(you can rename it);
  3. Using Mac command tool iconutil -c icns app.iconset to create app.icns file;
  4. Adding ICON = app.icns to pro file;
  5. Removing debug folder and to rebuilding project.

That is all.

附加问题描述

这是刚接触Qt的时候,遇到的一个小问题,如下:

同学编写的小程序里,建立了资源文件夹,并在里面加入了(ico,png图片)而且在MainWindows窗口属性的windowsIcon的属性里,设置了图片。本以为这样就可以设置debug里面的exe的应用程序的图标。但是,现实的情况是,程序里面的图标变了,但debug里面的没有变。

解决方法:

通过我们的多次尝试,这个问题算是初步解决了。

  • 我们怀疑是设置冲突问题,也就是说资源文件和独自创建的ico冲突了。所以,我们把资源文件删除了.使用【】里面的方式设置,成功。
  • 然后我们又把资源文件加上,而那个ico文件没有加入。重新构建,成功。
2018_03_24更新

How to set Qt Application Icon in Linux

you can to read below links and reference.

  1. Setting Application in linux, Qt Help manual keyword Setting Application Icon
  2. Desktop Entry
  3. Icon theme

In my Ubuntu

we can to see how the QtCreater to set the application icon.

/home/joe/.local/share/applications/DigiaQt-qtcreator-community.desktop
/home/joe/.local/share/icons/hicolor
tree .
.
├── 128x128
│ └── apps
│ └── QtProject-qtcreator.png
├── 16x16
│ └── apps
│ └── QtProject-qtcreator.png
├── 24x24
│ └── apps
│ └── QtProject-qtcreator.png
├── 256x256
│ └── apps
│ └── QtProject-qtcreator.png
├── 32x32
│ └── apps
│ └── QtProject-qtcreator.png
├── 48x48
│ └── apps
│ └── QtProject-qtcreator.png
├── 512x512
│ └── apps
│ └── QtProject-qtcreator.png
└── 64x64
└── apps
└── QtProject-qtcreator.png

or

/usr/share/applications/     /** has many desktop file */
/usr/share/icons/hicolor /** has all app icons */


Qt Setting Application Icon的更多相关文章

  1. Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest

    情况是这样子的,导入一个比较老的项目(两年前),它依赖于一个 Libraray,已经先导入了 library,现在导入项目的时候出了错 (1) Android Studio 目前提供将 SDK包成 . ...

  2. An application icon

    The application icon is a small image which is usually displayed in the top left corner of the title ...

  3. Qt Widgets Application可执行程序发布方式

    前言 写好的Qt程序想打包发布,之前按照Qt快速入门系列教程里的方法,直接选release,构建,之后找到exe,拷贝几个dll,然而报错如图: 后来找到教程:http://tieba.baidu.c ...

  4. iOS 点击Application icon加载推送通知Data

    今天做APNS远程推送通知遇到了一个问题,就是手机接收到通知的时候,如果马上点击通知的 alert view时候,系统马上唤醒你的Application,通知或调用你的didReceiveLocalN ...

  5. 【iOS开发-71】解决方式:Attempting to badge the application icon but haven't received permission from the...

    (1)原因 一切都是iOS8捣的鬼.您假设把模拟器换成iOS7.1或者更早的,就不会有这个问题.而如今在iOS8中要实现badge.alert和sound等都需要用户允许才干,由于这些都算做Notif ...

  6. Attempting to badge the application icon but haven't received permission from the user to badge the application错误解决办法

    今天刚刚学习UIApplication对象,当我希望利用这个对象在我们的应用图标上显示个数字的时候,xcode报了这个错误:  解决办法 : - (IBAction)applicationClicke ...

  7. 更改Qt Application为 Qt Console Application

    工程属性 -> 链接器 -> 系统 -> 子系统 : 更改为 控制台 (/SUBSYSTEM:CONSOLE)

  8. Qt Console Application

    代码编译完生成的.o文件(又称对象文件,是可执行文件)和链接.o文件形成的.exe可执行文件都保存在“build-Project-Desktop_Qt_5_8_0_GCC_64bit-Debug”中. ...

  9. Create a Qt Widget Based Application—Windows

    This turtorial describes how to use Qt Creator to create a small Qt application, Text Finder. It is ...

随机推荐

  1. CentOS6.5安装中文支持

    本人在安装CentOS6.5时选择是英文版,安装后打开文档,发现好些文档成了乱码了. 这个问题的原因是没有中文支持. 解决方法: 1.安装中文支持包 # yum groupinstall " ...

  2. date.js

    /** * 此JS文件是格式化JS中日期时间的工具类,其中包含了传入日期对象Date,格式化成想要的格式,<br> * 或者传入字符串格式的时间个,次字符串日期对应的格式可以转换为相应的日 ...

  3. mysql实战优化之一:sql优化

    1.选取最适用的字段属性 MySQL 可以很好的支持大数据量的存取,但是一般说来,数据库中的表越小,在它上面执行的查询也就会越快.因此,在创建表的时候,为了获得更好的性能,我们可以将表中字段的宽度设得 ...

  4. zufeoj NO.1(结构体简单题)

    NO.1 时间限制: 1 Sec  内存限制: 128 MB提交: 457  解决: 172[提交][状态][讨论版] 题目描述 所谓NO.1,就是所有成绩都排在第一的同学,我们假设每个人只有理科,文 ...

  5. json用法常见错误

    Json用法三个常见错误   net.sf.json.JSONException: java.lang.NoSuchMethodException

  6. Linux学习笔记 -- 文件包含

    简述 简单来讲,shell 中的文件包含指的是在一个文件中引用另外一个文件.通过这种方式,我们可以将一些公用的代码封装为一个独立的文件,并在需要的时候引用它即可. 语法 . filename # 注意 ...

  7. 【UVA】201 Squares(模拟)

    题目 题目     分析 记录一下再预处理一下.     代码 #include <bits/stdc++.h> int main() { int t=0,s,n; while(scanf ...

  8. CocoStudio资源区导入Plist/PSD文件

    这两种文件在使用中和普通文件稍有不同,下作简单介绍.如有不适的地方欢迎批评指正. 首先简单说一下Plist文件,Plist文件通常用于储存用户设置,也可以用于存储捆绑的信息,该功能在旧式的Mac OS ...

  9. Linux系统级别能够打开的文件句柄的数file-max命令

    简单的说, max-file表示系统级别的能够打开的文件句柄的数量, 而ulimit -n控制进程级别能够打开的文件句柄的数量. man 5 proc, 找到file-max的解释:file-max中 ...

  10. 优化笔记:pfyhparopenfundinfotest_D_20140916.gz

    性能瓶颈在函数的乱用.原代码黄色部分. 12分钟->35秒 ------------------------------------------------------------------- ...