Thank you for your time! I have tried all of these settings, I've restarted the program each time. There is no change - just 16x16 and 32x32 icon resolutions are available. Could this be a Qt restriction for performance reason?
Thank you for your time! I have tried all of these settings, I've restarted the program each time. There is no change - just 16x16 and 32x32 icon resolutions are available. Could this be a Qt restriction for performance reason?
I have the same issue (not a big deal, though) with the icons for my actions - Qt wasn't displaying them beyond a certain size. Since there is action titles (Edit, Open, New), tool tip, etc., I didn't bother deploying bigger icons.
Thanks for confirming the problem! For me it is actually quite important to have 128x128 (or at least 64x64) px, the actual graphic representations for my users will have edge lenghts between 100 and 250 px.
Is this behaviour documented in any way? If yes, I must have missed it. I could understand a reasonable performance compromise, but imho the QFileIconProvider should at least have an non-default option for supplying bigger icons. I can't believe that this is not a problem for many other users...
The only alternative that I see right now is a lenghty list of suffix-based ifs that point to hardcoded and deployed icons. But these would have no reference to the users system settings and possibilities regarding the opening of a file.
Last edited by sedi; 27th December 2016 at 18:44.
You can derive from QFileIconProvider and override the icon() method to add larger / smaller pixmaps to the set of default sizes. You could add these either by scaling existing pixmaps up / down or by creating your own.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
You are right, I can provide my own icons that way, but then they do not reflect the software situation on my user's machine.
But shouldn't QFileIconProvider return bigger icons by default? I've tried to find the answer in the Qt sources, but I don't understand too much of the code there.
The actual work seems to be done in qwindowstheme.cpp, and at least I've found this snippet here:
Qt Code:
enum { // Shell image list ids sHIL_EXTRALARGE = 0x2, // 48x48 or user-defined sHIL_JUMBO = 0x4 // 256x256 (Vista or later) };To copy to clipboard, switch view to plain text mode
So it doesn't seem to be a deliberate omission after all.
The QIcon documentation says that if you ask for an pixmap that is -smaller- than the available sizes and no pixmap of that size has been set, then it will scale a larger pixmap down. However, it will not scale a smaller pixmap into a larger one. So if 32 x 32 is the largest size available, then you'll have to supply your own if you want something larger. If you derive from QFileIconProvider, then you can always do this scaling up yourself instead of having to invent new pixmaps and put them into resources.
You're not the only one with that problem...the Qt sources, but I don't understand too much of the code there.![]()
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks