[Interest] Linux: can't get small icon from QIcon

Alexander Dyagilev alervdvcw at gmail.com
Mon Feb 24 14:20:03 CET 2020


Hello,

In my app, I use this:

app.setWindowIcon(QIcon(":/icon.ico"));

This .ico file has 5 sizes: 16x16, 24x24, 32x32, 48x48 and 256x256. This 
is how Visual Studio shows them (sorry for the rotation xD):

The problem is that under Linux, "App is ready" window is extremely and 
ugly big for our app.

This is because it picks up the biggest icon (256x256).

I've tried to extract small icon from QIcon, but it did not help:

QIcon icon(":/icon.ico");
auto pm = icon.pixmap(QSize(32,32));
app.setWindowIcon(icon);

Then I just removed this 256x256 icon from my icon.ico file, built the 
app, and now it works fine:

I would like to avoid having several .ico files inside of my project. Is 
there away to remove this 256x256 in runtime using Qt? Or is there any 
other solution for this problem?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200224/7a44ac25/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbnklpiccglaakml.png
Type: image/png
Size: 7535 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200224/7a44ac25/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ofdjbgcgmhllbkmj.png
Type: image/png
Size: 24236 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200224/7a44ac25/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hngahbaejdhkdpgo.png
Type: image/png
Size: 7049 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200224/7a44ac25/attachment-0002.png>


More information about the Interest mailing list