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. 从汇编的角度看待const与#define

    先观察一下的代码: #include<stdio.h> int main(){ ; int y; int *pi=(int*)&i; *pi=; y=*pi; int tempi; ...

  2. 在Mac OS上搭建Python的开发环境

    本文转载自:http://www.jb51.net/article/76931.htm 一. 安装python mac系统其实自带了一个python的执行执行环境,用来运行python还行,但是开发可 ...

  3. Appium+python自动化27-等待activity出现(android特有的wait_activity)

    前言 在启动app的时候,如果直接做下一步点击操作,经常会报错,于是我们会在启动完成的时候加sleep. 那么问题来了,这个sleep时间到底设置多少合适呢?设置长了,就浪费时间,设置短了,就会找不到 ...

  4. Java 面向对象 初探

    public class test { public static void main(String[] args) { // 利用new关键字创建了一个Person对象 Person p = new ...

  5. 纯css实现点击事件

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. ping正常但是ssh到linux服务器很卡的解决方法

    ssh登录很慢的问题  1.关闭ssh DNS反向解析 vi /etc/ssh/sshd_config 修改UseDNS no 2.关闭 GSSAPI 的用户认证   vi /etc/ssh/sshd ...

  7. C++类够做函数初始化列表

    构造函数初始化列表以一个冒号开始,接着是以逗号分隔的数据成员列表,每个数据成员后面跟一个放在括号中的初始化式.例如: class CExample{ public: int a; float b; C ...

  8. 【转】WebAPI使用多个xml文件生成帮助文档

    来自:http://www.it165.net/pro/html/201505/42504.html 一.前言 上篇有提到在WebAPI项目内,通过在Nuget里安装(Microsoft.AspNet ...

  9. poj-2828 Buy Tickets(经典线段树)

    /* Buy Tickets Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 10207 Accepted: 4919 Descr ...

  10. GridControl 添加全选列

    这里通过List对象绑定GridControl,且不用在GirdControl界面中添加任何列,实现CheckBox列的方法 1.列表中出现CheckBox列 非常简单,在绑定的List实体中,增加一 ...