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

QT += core
QT -= gui
QT += widgets
CONFIG += c++11
TARGET = FileIconProviderProblem
SOURCES += main.cpp

#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;
}
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to