GroupArtistDataModelDecorator.cpp Example File
listdecorators/src/GroupArtistDataModelDecorator.cpp
#include "GroupArtistDataModelDecorator.hpp"
GroupArtistDataModelDecorator::GroupArtistDataModelDecorator(QObject* parent)
: bb::cascades::datamanager::DataModelDecorator(parent)
{
}
GroupArtistDataModelDecorator::~GroupArtistDataModelDecorator() {
}
QString GroupArtistDataModelDecorator::itemType(const QVariantList& indexPath) {
QVariant data = bb::cascades::datamanager::DataModelDecorator::data(
indexPath);
if (data.isValid()) {
QVariantMap map = data.value<QVariantMap>();
int isGroup = map["is_group"].toInt();
if (isGroup) {
return QString("group");
}
}
return QString("");
}