74 lines
1.2 KiB
C++
74 lines
1.2 KiB
C++
|
#include "tycho.h"
|
||
|
|
||
|
MapModel::MapModel(QObject *parent) :
|
||
|
AbstractMapModel(parent),
|
||
|
ProjectModel()
|
||
|
{
|
||
|
dbgPrintFunc();
|
||
|
}
|
||
|
|
||
|
MapModel::~MapModel()
|
||
|
{
|
||
|
dbgPrintFunc();
|
||
|
}
|
||
|
|
||
|
ProjectModel::Type MapModel::type() const
|
||
|
{
|
||
|
return ProjectModel::Map;
|
||
|
}
|
||
|
|
||
|
QAbstractItemModel const *MapModel::getAbstract() const
|
||
|
{
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
QAbstractItemModel *MapModel::getAbstract()
|
||
|
{
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
MapModel const *MapModel::getMap() const
|
||
|
{
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
MapModel *MapModel::getMap()
|
||
|
{
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
bool MapModel::isDirty() const
|
||
|
{
|
||
|
return AbstractMapModel::isDirty();
|
||
|
}
|
||
|
|
||
|
bool MapModel::open(QString const &path)
|
||
|
{
|
||
|
return AbstractMapModel::open(path);
|
||
|
}
|
||
|
|
||
|
bool MapModel::save() const
|
||
|
{
|
||
|
return AbstractMapModel::save();
|
||
|
}
|
||
|
|
||
|
bool MapModel::saveAs(QString const &path) const
|
||
|
{
|
||
|
return AbstractMapModel::saveAs(path);
|
||
|
}
|
||
|
|
||
|
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 AbstractMapModel::data(index, role);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// EOF
|