Lots of changes again
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include "spritesmodel.h"
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
SpritesModel::SpritesModel(QObject *parent)
|
||||
: QAbstractListModel{parent}
|
||||
{
|
||||
}
|
||||
|
||||
int SpritesModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
QVariant SpritesModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
switch (role)
|
||||
{
|
||||
case Qt::DisplayRole:
|
||||
case Qt::EditRole:
|
||||
return tr("image %0").arg(index.row());
|
||||
case Qt::DecorationRole:
|
||||
QPixmap pixmap{64, 64};
|
||||
pixmap.fill(Qt::black);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
Reference in New Issue
Block a user