summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveplotdatamodel.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-21 15:31:56 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-21 11:35:24 -0800
commitce7c3f8314ceedd82364ce441b73983ee62f3aaf (patch)
tree58d212a52ef48b630388dec5d76b3c892e74fc5b /qt-ui/profile/diveplotdatamodel.cpp
parent8065374793908894b47cfd1c2bb0b9913d404bb4 (diff)
downloadsubsurface-ce7c3f8314ceedd82364ce441b73983ee62f3aaf.tar.gz
Add the tissues to the profile graph
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r--qt-ui/profile/diveplotdatamodel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp
index b32918bc5..6635ff1d0 100644
--- a/qt-ui/profile/diveplotdatamodel.cpp
+++ b/qt-ui/profile/diveplotdatamodel.cpp
@@ -38,6 +38,11 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const
case SAC: return item.sac;
}
}
+
+ if (role == Qt::DisplayRole && index.column() >= TISSUE_1 && index.column() <= TISSUE_16){
+ return item.ceilings[ index.column() - TISSUE_1];
+ }
+
if (role == Qt::BackgroundRole) {
switch (index.column()) {
case COLOR: return getColor((color_indice_t)(VELOCITY_COLORS_START_IDX + item.velocity));
@@ -77,6 +82,9 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation,
case CEILING: return tr("Ceiling");
case SAC: return tr("SAC");
}
+ if (role == Qt::DisplayRole && section >= TISSUE_1 && section <= TISSUE_16){
+ return QString("Ceiling: %1").arg(section - TISSUE_1);
+ }
return QVariant();
}