Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
-
Pixel 4 API Level 31 Emulator; iOS 18.2 Simulator
Description
Code
#include <QtWidgets> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget win; auto layout = new QVBoxLayout(&win); QAbstractFileIconProvider provider; QMap<QString, QIcon> iconMap { {"Computer", provider.icon(QAbstractFileIconProvider::Computer)}, {"Desktop", provider.icon(QAbstractFileIconProvider::Desktop)}, {"Trashcan", provider.icon(QAbstractFileIconProvider::Trashcan)}, {"Network", provider.icon(QAbstractFileIconProvider::Network)}, {"Drive", provider.icon(QAbstractFileIconProvider::Drive)}, {"Folder", provider.icon(QAbstractFileIconProvider::Folder)}, {"File", provider.icon(QAbstractFileIconProvider::File)}, {"CSV File", provider.icon(QFileInfo("dummy.csv"))}, {"JPG File", provider.icon(QFileInfo("dummy.jpg"))}, {"PDF File", provider.icon(QFileInfo("dummy.pdf"))} }; for (const auto& key : iconMap.keys()) { auto icon = iconMap[key]; qDebug() << key << "Icon null?:" << icon.isNull(); layout->addWidget(new QPushButton(icon, key)); } win.show(); return a.exec(); }
Outcomes
- (Windows/macOS) All icons are not null; the buttons show text + icons (Expected)
- (Android/iOS) All icons are null; the buttons only show text (Not Expected)
Notes
Changing from QAbstractFileIconProvider to QFileIconProvider makes icon(QAbstractFileIconProvider::IconType) return icons on the mobile platforms, but this imposes a dependency on Qt Widgets. It also doesn't help icon(const QFileInfo &)
Attachments
Issue Links
- relates to
-
QTBUG-124829 The appearance of icons in QFileSystemModel is simplified and differs from the typical Windows icons.
-
- Closed
-
-
QTBUG-134240 Clarify the split between QAbstractFileIconProvider + QFileIconProvider
-
- Reported
-