QTfrontend/model/ThemeModel.cpp
branchphysfslayer
changeset 7955 85b3970b402a
parent 7776 e78eff243e25
child 8049 133e22b5c410
equal deleted inserted replaced
7951:c64c0b413ff7 7955:85b3970b402a
    76 
    76 
    77         // set name
    77         // set name
    78         dataset.insert(Qt::DisplayRole, theme);
    78         dataset.insert(Qt::DisplayRole, theme);
    79 
    79 
    80         // load and set icon
    80         // load and set icon
    81 
    81         QIcon icon(iconpath);
    82         QPixmap pix(iconpath); // workaround, as QIcon(iconpath) and even QIcon(QPixmap(iconpath)) don't work
       
    83         QIcon icon(pix);
       
    84 
    82 
    85         dataset.insert(Qt::DecorationRole, icon);
    83         dataset.insert(Qt::DecorationRole, icon);
    86 
    84 
    87         // load and set preview icon
    85         // load and set preview icon
    88         pix.load(datamgr.findFileForRead(QString("Themes/%1/icon@2x.png").arg(theme)));
    86         QIcon preview(datamgr.findFileForRead(QString("Themes/%1/icon@2x.png").arg(theme)));
    89         QIcon preview(pix);
       
    90         dataset.insert(Qt::UserRole, preview);
    87         dataset.insert(Qt::UserRole, preview);
    91 
    88 
    92         m_data.append(dataset);
    89         m_data.append(dataset);
    93     }
    90     }
    94 
    91