last changes
This commit is contained in:
@@ -29,7 +29,15 @@ QVariant AlienModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
return aliens.at(index.row()).name;
|
||||
return aliens.at(index.row()).name;
|
||||
}
|
||||
return QVariant();
|
||||
if (role == Qt::DecorationRole)
|
||||
{
|
||||
return QIcon(":/icons/icons/list-add.png");
|
||||
}
|
||||
if (role == Qt::ToolTipRole)
|
||||
{
|
||||
return tr("id=%1").arg(aliens.at(index.row()).id);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user