diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-08 10:12:43 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-08 10:12:43 -0800 |
commit | d143527732b9a8db554f8756a2ff08dd93438b09 (patch) | |
tree | 8ff4dee63aff37e49b16fac48d0a588ced134936 /qt-ui | |
parent | 1ce2d42e8d7165de117eab60c89a003794425ce8 (diff) | |
download | subsurface-d143527732b9a8db554f8756a2ff08dd93438b09.tar.gz |
Dive d/l selection UI: show reasonable column headers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 17 | ||||
-rw-r--r-- | qt-ui/downloadfromdivecomputer.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 07e4afad3..e61668d73 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -522,6 +522,23 @@ int DiveImportedModel::rowCount(const QModelIndex &model) const return lastIndex - firstIndex; } +QVariant DiveImportedModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Vertical) + return QVariant(); + if (role == Qt::DisplayRole) { + switch (section) { + case 0: + return QVariant(tr("Date/time")); + case 1: + return QVariant(tr("Duration")); + case 2: + return QVariant(tr("Depth")); + } + } + return QVariant(); +} + QVariant DiveImportedModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index ea272599e..80b184304 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -33,6 +33,7 @@ public: int columnCount(const QModelIndex& index = QModelIndex()) const; int rowCount(const QModelIndex& index = QModelIndex()) const; QVariant data(const QModelIndex& index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; bool setData(const QModelIndex &index, const QVariant &value, int role); void setImportedDivesIndexes(int first, int last); Qt::ItemFlags flags(const QModelIndex &index) const; |