diff options
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r-- | qt-ui/models.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h index 2a9945aeb..75c3e08ac 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -274,4 +274,24 @@ public: int columnCount(const QModelIndex &parent) const; }; +/* ProfilePrintModel: + * this model is used when printing a data table under a profile. it requires + * some exact usage of setSpan(..) on the target QTableView widget. + */ +class ProfilePrintModel : public QAbstractTableModel +{ + Q_OBJECT + +private: + struct dive *dive; + QString truncateString(char *str, const int maxlen) const; + +public: + ProfilePrintModel(QObject *parent = 0); + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + void setDive(struct dive *divePtr); +}; + #endif |