QTfrontend/model/roomslistmodel.cpp
changeset 6987 e34415c77342
parent 6983 ede55af89e78
child 6993 47830cf50574
--- a/QTfrontend/model/roomslistmodel.cpp	Wed May 02 08:07:17 2012 +0100
+++ b/QTfrontend/model/roomslistmodel.cpp	Wed May 02 10:47:21 2012 +0200
@@ -92,11 +92,13 @@
 
     // not a role we have data for
     if (role != Qt::DisplayRole)
-        // only decorate name column
-        if ((role != Qt::DecorationRole) || (column != 1))
-            // only dye map column
-            if ((role != Qt::ForegroundRole) || (column != 5))
-                return QVariant();
+        // only custom-align counters
+        if ((role != Qt::TextAlignmentRole) || (column < 2) || (column > 3))
+            // only decorate name column
+            if ((role != Qt::DecorationRole) || (column != 1))
+                // only dye map column
+                if ((role != Qt::ForegroundRole) || (column != 5))
+                    return QVariant();
 
     // decorate room name based on room state
     if (role == Qt::DecorationRole)
@@ -146,6 +148,11 @@
             return QVariant();
     }
 
+    if (role == Qt::TextAlignmentRole)
+    {
+        return (int)(Qt::AlignHCenter | Qt::AlignVCenter);
+    }
+
     Q_ASSERT(false);
     return QVariant();
 }