QVariant PlayersModel::data(const QModelIndex &index, int role) const
{
+ if (role == Qt::TextAlignmentRole) {
+ if (index.column() == 0) {
+ return (Qt::AlignHCenter | Qt::AlignVCenter).toInt();
+ } else if (index.column() == 1) {
+ return (Qt::AlignHCenter | Qt::AlignVCenter).toInt();
+ } else {
+ return (Qt::AlignLeft | Qt::AlignVCenter).toInt();
+ }
+ }
if (role != Qt::DisplayRole) {
return QVariant();
}