exe icon is not full size



  • Hello,

    I want to set an icon for my program (exe file and desktop shortcut). I am using Qt 5.7 on Windows.
    I followed the instructions from: http://doc.qt.io/qt-5/appicon.html, that is in the pro file I put "RC_ICONS = logo7.ico".

    When I install the program on my computer (Win8), it works well. The desktop shortcut's icon shows my logo perfectly and full size. However, when I install the program on another computer (Win10), the desktop shortcut's icon is not full size. Even if I CTRL-scroll on the desktop to change the icon size, this icon remains the same size.

    Here is an example of two desktop icons (one full and the other one that does not scale).
    alt text

    Is there something special I should do with my icon (I tried icon sizes of 128x128 to 512x512) so that its full screen ?
    Or is it something to do in Qt ?

    Thank you so much !

    Alex



  • This post is deleted!


  • I managed to find a part of the problem.
    The first problem is not Qt related: I had to add layers of different sizes in my .ico
    https://stackoverflow.com/questions/4354617/how-to-make-get-a-multi-size-ico-file

    However, a Qt problem arises.
    At first, to insert my logo in the .exe file, I did:

    add existing file logo1.ico in my project tree
    In the pro file, I added RC_ICONS = logo1.ico
    I tried to replace this logo by a totally different one (logo2.ico).

    I deleted logo1.ico
    add existing file logo2.ico in my project tree
    In the pro file, I replaced this line with RC_ICONS = logo2.ico
    The problem is that when I compile, its always the old logo that I see on the .exe (logo1).
    I deleted the .exe before compiling, I deleted the .prouser and started from scratch but it always the old logo1 that reappears on the .exe....
    --> if I copy paste the .exe, the copied file has the good icon. But if I rename the file to the original .exe, the old logo comes back. If I create a shortcut on the desktop, it has the old logo....

    I have no idea how this can be.....

    I have been able to reproduce this problem with a new Qt project. I started a new project and set-up an icon. It worked. I tried to change it to another one and its always the old one that comes back. I tried deleting the build folder and the .prouser but nothing is working !

    Thanks !



  • Hi, I also had this problem with "ghost" icons that would never go away on the Windows desktop, it occurs because Windows likes to cache the icons (to be able to show all the desktop icons faster I guess). The trick is to clear the cache, for more see here



  • @hskoglund thank you so much, I thought I was crazy !
    Quick question though: let's say I sell my program to customers and that later I want to change my program icon. I would send them an updated version of my program but it's possible that it does not update on their computer because of the cache problem ? I don't think I could ask them to clear their cache and everything....



  • @alecs26 about that question: if you have some kind of installation program, that might help clearing the cache.
    Otherwise, I think one solution is to append the version number in the filename, e.g. first version: MyProgramv1.exe. then: MyProgramv2.exe etc. Because the filenames are different, the old icon will not be used (the new one will show). Of course you'll then have the problem of deleting old/obsolete versions, another fine can of worms :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.