[Interest] QFileIconProvider - icon resolutions only 16x16 and 32x32 on Windows

mail at herrdiel.de mail at herrdiel.de
Tue Dec 27 16:25:13 CET 2016


Hi,

I want to access file icons of the OS, I need them in "good quality", 
but the available sizes are apparently only available in 16x16 and 32x32 
px.

My system is Windows 10 64bit, Qt 5.7.1, MinGw 5.3.0

Please find a minimal compileable example attached. FYC the relevant 
part is pasted here:

@
QFileIconProviderprovider;
QDirdir("c:/");
for(autoinfo:dir.entryInfoList()){
qDebug()<<info.fileName()<<provider.icon(info).availableSizes();
}
@

The output is like
"AndroidSDK" (QSize(16, 16), QSize(32, 32))
"apache-ant-1.9.6" (QSize(16, 16), QSize(32, 32))
"Drivers" (QSize(16, 16), QSize(32, 32))
"eula.1031.txt" (QSize(16, 16), QSize(32, 32))
"Intel" (QSize(16, 16), QSize(32, 32))
"JavaJDK" (QSize(16, 16), QSize(32, 32))
"Oh Freedom.mp3" (QSize(16, 16), QSize(32, 32))
"Program Files" (QSize(16, 16), QSize(32, 32))
[...]

I would have expected higher icon resolutions (64x64 and more) to be 
present.
Is this a bug or perhaps a (possibly performance related) restriction?

Or am I doing/expecting something stupid here...?

Best regards,
Sebastian

-- 
http://www.classintouch.de - Tablet-Software für Lehrer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161227/1d8beef3/attachment.html>
-------------- next part --------------
QT += core
QT -= gui
QT += widgets
CONFIG += c++11
TARGET = FileIconProviderProblem
SOURCES += main.cpp

-------------- next part --------------
#include <QApplication>
#include <QtWidgets/QFileIconProvider>
#include <QDir>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Q_UNUSED(a);
    QFileIconProvider provider;
    QDir dir("c:/");
        for (auto info : dir.entryInfoList()) {
        qDebug()<<info.fileName() << provider.icon(info).availableSizes();
    }
    return 0;
}


More information about the Interest mailing list