If you don't want to use custom delegates, you can set this in data
function of your model implementation, using Qt::TextAlignmentRole
:
QVariant MyModel::data ( const QModelIndex & index, int role = Qt::DisplayRole )
{
if (role == Qt::TextAlignmentRole )
return Qt::AlignCenter;
else
return QAbstractItemModel::data(index, role);
}