Set QT app icon under Windows

Source: Internet
Author: User

Platform: Win7 64-bit +QT Creator 3.6.1

1. First, to obtain an. ico format picture file, https://www.iconfinder.com/If you feel that you do not have the appropriate ICO image, you can get it from this website, maybe there are pictures you need. I downloaded a picture like this:


The picture gets placed under the project folder, can be placed in the project root directory, or can be placed under a sub-folder. I put it: Project root directory/res/myapp.ico, the red part is different depending on your project.


2. Create a new. rc file:

Right-click to add a new file



Select General->empty File



Enter the file name (the file name is Custom) and click Next


Click Finish


The following files will then be generated:



Enter the following in the newly created file:

Idi_icon1 ICON discardable "./res/myapp.ico"

The red part differs depending on the individual item.

3. Edit the. Pro file


Enter the following content:


Then recompile and run the program to see the effect.



Set QT app icon under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.