QT app icon

Source: Internet
Author: User

QT generates an EXE file with icons under Windows (IDE=QT Creator)

I personally love the IDE interface and operation of Qt creator, but perhaps not fully mature or for the code cross-platform, some features are not directly provided.

such as Windows software, at least as the main program or the EXE file launcher should generally have its own icon, QT Creator Although it is easy to set the small window icon, but does not provide the ability to set the EXE file icon.

In fact, it is not difficult to do.

• First of all, of course, prepare an. ico icon file (assumed to be Myicon.ico) and copy it to the project directory (the directory where the. Pro file resides).

• Then CTRL + N or file-new File or Project in Qt Creator

Select the text File in general

Name is filled with an. rc file (e.g. myrc.rc)

Just write a line in it:

Idi_icon1 ICON discardable "Myicon.ico"

• Edit the. Pro file, which should have:

+ = Apprc.rc

Add another line below it (if you don't have the above content):

rc_file = \
Myrc.rc

• Just compile it and the newly generated EXE will become Myicon.ico.


QT app icon

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.