src/model.cpp

changeset 158
5bd755eaa5a8
parent 153
2f79053c2e9a
child 159
1a04364d20b5
equal deleted inserted replaced
157:869fe95c4e5e 158:5bd755eaa5a8
77 QVariant Model::data(const QModelIndex& index, int role) const 77 QVariant Model::data(const QModelIndex& index, int role) const
78 { 78 {
79 const ldraw::Object* object = (*this)[index.row()]; 79 const ldraw::Object* object = (*this)[index.row()];
80 switch(role) 80 switch(role)
81 { 81 {
82 case Qt::DecorationRole:
83 return QPixmap{object->iconName()}.scaledToHeight(24);
82 case Qt::DisplayRole: 84 case Qt::DisplayRole:
83 return object->textRepresentation(); 85 return object->textRepresentation();
84 case Qt::ForegroundRole: 86 case Qt::ForegroundRole:
85 return object->textRepresentationForeground(); 87 return object->textRepresentationForeground();
86 case Qt::BackgroundRole: 88 case Qt::BackgroundRole:

mercurial