Workaround over QIcon failing to load from physfs physfslayer
authorunc0rr
Sun, 21 Oct 2012 00:34:14 +0400
branchphysfslayer
changeset 7776 e78eff243e25
parent 7774 27f9b9362f47
child 7778 3331b30e4ef1
Workaround over QIcon failing to load from physfs
QTfrontend/model/ThemeModel.cpp
--- a/QTfrontend/model/ThemeModel.cpp	Sun Oct 21 00:33:38 2012 +0400
+++ b/QTfrontend/model/ThemeModel.cpp	Sun Oct 21 00:34:14 2012 +0400
@@ -78,11 +78,15 @@
         dataset.insert(Qt::DisplayRole, theme);
 
         // load and set icon
-        QIcon icon(iconpath);
+
+        QPixmap pix(iconpath); // workaround, as QIcon(iconpath) and even QIcon(QPixmap(iconpath)) don't work
+        QIcon icon(pix);
+
         dataset.insert(Qt::DecorationRole, icon);
 
         // load and set preview icon
-        QIcon preview(datamgr.findFileForRead(QString("Themes/%1/icon@2x.png").arg(theme)));
+        pix.load(datamgr.findFileForRead(QString("Themes/%1/icon@2x.png").arg(theme)));
+        QIcon preview(pix);
         dataset.insert(Qt::UserRole, preview);
 
         m_data.append(dataset);