Maraiah/tycho/cc/mapmodel.cc

45 lines
718 B
C++

#include "tycho.h"
MapModel::MapModel(Project *parent) :
IMapModel(parent)
{
dbgPrintFunc();
}
MapModel::~MapModel()
{
dbgPrintFunc();
}
void MapModel::deselect()
{
IMapModel::deselect();
emit deselected();
}
void MapModel::select(QModelIndex const &index)
{
auto idx = index.internalId();
IMapModel::select(idx);
emit selected(idx);
}
QVariant MapModel::data(const QModelIndex &index, int role) const
{
switch(role) {
case Qt::DecorationRole: {
auto name = propIcon(index.row());
auto icon = name.front() == ':' ? QIcon(name)
: QIcon::fromTheme(name);
return QVariant::fromValue(icon);
}
default:
return IMapModel::data(index, role);
}
}
// EOF