Return the pixmap in
QVariant QAbstractItemModel::data(const QModelIndex& index, int role = Qt::DisplayRole) const
To copy to clipboard, switch view to plain text mode
for role Qt::DecorationRole.
more or less like this:
QVariant MyModel
::data(const QModelIndex
& index,
int role
= Qt
::DisplayRole) const {
if (role == Qt::DecorationRole)
{
}
...
}
QVariant MyModel::data(const QModelIndex& index, int role = Qt::DisplayRole) const
{
if (role == Qt::DecorationRole)
{
return QPixmap("some.png");
}
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks