summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2014-10-29 18:23:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-29 09:29:14 -0700
commitd5f19c43c925468f363f0e509816df724f930db9 (patch)
tree03f79fa270cebf5d906ecdae432f7f18ee9c9db2 /qt-ui/models.cpp
parent9e4cc810686e4239f008e0ce3fb1cef5395b1e6e (diff)
downloadsubsurface-d5f19c43c925468f363f0e509816df724f930db9.tar.gz
Divelist: make the column headers for units left aligned
Fixes #739 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index ef76e7e51..f548d3730 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1081,7 +1081,7 @@ static int nitrox_sort_value(struct dive *dive)
return he * 1000 + o2;
}
-static QVariant dive_table_alignment(int column)
+static QVariant dive_table_alignment(int column, bool isHeader)
{
QVariant retVal;
switch (column) {
@@ -1093,7 +1093,7 @@ static QVariant dive_table_alignment(int column)
case DiveTripModel::OTU:
case DiveTripModel::MAXCNS:
// Right align numeric columns
- retVal = int(Qt::AlignRight | Qt::AlignVCenter);
+ retVal = int((isHeader ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignVCenter);
break;
// NR needs to be left aligned becase its the indent marker for trips too
case DiveTripModel::NR:
@@ -1116,7 +1116,7 @@ QVariant DiveItem::data(int column, int role) const
switch (role) {
case Qt::TextAlignmentRole:
- retVal = dive_table_alignment(column);
+ retVal = dive_table_alignment(column, false);
break;
case DiveTripModel::SORT_ROLE:
Q_ASSERT(dive != NULL);
@@ -1353,7 +1353,7 @@ QVariant DiveTripModel::headerData(int section, Qt::Orientation orientation, int
switch (role) {
case Qt::TextAlignmentRole:
- ret = dive_table_alignment(section);
+ ret = dive_table_alignment(section, true);
break;
case Qt::FontRole:
ret = defaultModelFont();