]> git.sesse.net Git - pkanalytics/commitdiff
Nicer alignment of the player table.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 May 2023 16:32:15 +0000 (18:32 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 May 2023 16:32:15 +0000 (18:32 +0200)
players.cpp

index 21e9bdf7e4571c644b643ceaad7398d573de7288..1854408d1bac295bce03337b5e4e28405375a721 100644 (file)
@@ -35,6 +35,15 @@ QVariant PlayersModel::headerData(int section, Qt::Orientation orientation, int
 
 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();
        }