I have successfully changed the icon in my window's left up corner using the .rc file.
However, the icon in the windows' file system remain the same as before.
How could I change that too?
In Qt 4, you need to create a .rc file like this:
IDI_ICON1 ICON DISCARDABLE "myIcon.ico"
You should add this to your .pro file :
win32: RC_FILE += MyApp.rc
In Qt 5 there is an automated process for setting an icon to the application executable file .
You can just add the following to the .pro file:
win32: RC_ICONS = myIcon.ico
Also store the .ico file in your application's source code directory.
Please not that only that top left corner of the window icon is controlled by Qt: http://qt-project.org/doc/qt-4.8/appicon.html#notes
The executable icon isn't a GUI element so it really has nothing to do with Qt. It can be embedded in the executable by visual studio though: How do I set the icon for my application in visual studio 2008?
Related
Normally, you can set an exe icon for your program. But how about set an exe icon for your program without icon file (at least for win 32 project).
In run time, I can set the icon with
SHSTOCKICONINFO appIconInfo;
appIconInfo.cbSize = sizeof(SHSTOCKICONINFO);
HRESULT hr = SHGetStockIconInfo(SIID_DESKTOPPC, SHGSI_ICON, &appIconInfo);
But that can't set the icon of my exe file. I don't know if it's possible that I can do one of the following things:
Set up project so that Visual studio can build the exe file with the icon from Window's system, like the stock icon SIID_DESKTOPPC.
Create a text file code, so that the compiler read this code and generate the icon - I don't need any fancy thing - just a plain pink icon is good enough.
The reason I want to do this weird thing (yes, I know it's weird): Firstly, I want this whole funny project is just text - just code and code. Secondly, I can't create the icon file with Visual Studio, Paint or any other programs that come with default Windows. Thirdly, Just for fun.
This question difference with the question: How do I set the icon for my application in visual studio 2008? : This set icon for exe file without the .ico file.
I have build an app with Code::Block, C++ and wxWidgets. I have changed icon for frame successfully, but icon of .exe file is still there default.
how to change icon of .exe file?
Thanks
Edit .rc file (i.e. resource.rc) and set your icon where you find aaaa ICON.
I want to change my application exe icon from default. Now when I copied the new icon with same name as default icon had in "res" folder of application. when I compiled it's exe came with new icon.
But at the same time when I copied another icon with another name in "res" folder and include it in my project. Now rese folder has two icons(one icon is for application's icon). Now when I compiled my application that time exe come with new icon. But it should come with old icon as IDR_MAINFRAME holds.
Please help me out.
Thank You
you have to edit the .rc icon file directly. I think it's already write in duplicate post.
I'm Confused about set the application icon.
I have seen many explanations about set the application icon, but I'm still not understand.
Please I want a simple explanation, but step by step to understand it
What I have done:
I have created a Qt resource file(.qrc).
Then, I have added a prefix, then I have added the Icon file.
Then, from design mode and from property block I have changed the a property called windowIcon.
Then I have selected the Icon which I added before in the .qrc file.
Notice: I'm use Qt5.3 and windows 7.
Now, Please what is the right steps to set the application icon ?
You have done the right thing to set the main window icon. Just setting windowIcon property in the designer will set an icon for the application window.
For setting an icon to the application executable file there is an automated process In Qt 5.
You can just add the following to the .pro file:
win32: RC_ICONS = myIcon.ico
Also store the .ico file in your application's source code directory.
Note that this is only for Windows. There are other ways to set application icon in Linux and Mac.
I have an MFC application. When the application is launched, I see it is represented on the taskbar using the MFC logo. Also, the application Window Menu Bar has the MFC icon.
How can I replace these with custom made logos?
The icons are in the .ico file that is part of your project. Usually in the /res directory. You can edit them or replace them with files you generate.
The icon file is stored with your project files.
Go to <Projects Folder>\SOLUTIONNAME\PROJECTNAME\res. When you locate this folder, there should be a PROJECTNAME.ico file. rename the ico file you created to PROJECTNAME.ico. Next time you build your project, the MFC icon should be replaced with your custom icon.
I recommend going to this site mostly because it does not require any registration and its 100% free.
You can then fine a suitable icon for your program bu searching keywords.
Then select the .ICO type and download.
Copy the .ico file to your “res” folder.
Then delete the .ico file and rename the downloaded file to .ico.