diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-08-26 09:14:19 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-08-26 09:14:19 -0300 |
commit | 9856aaaa863b03994b2befdb255050a6686d6c12 (patch) | |
tree | f8f32cf309ff2b4d5e3c955611dc152cdeb9367b /qt-ui/diveplanner.h | |
parent | aceb002a33dcd5c2bb852e28d4f0de76c7cfced5 (diff) | |
download | subsurface-9856aaaa863b03994b2befdb255050a6686d6c12.tar.gz |
Started the Model to handle the DivePoints
Started the model to handle the divepoints between the
Qt Widget interface and the QGraphicsView one. good thing
is that we share code. Bad is that a model is harder to
work, but doable. :)
With this finished ( in a couple of commits ) one can
insert a point on the Qt widget or on the graphics view
and it will be 'mirrored' to both interfaces.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r-- | qt-ui/diveplanner.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 03e4d2bbe..dad13cd05 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -4,6 +4,7 @@ #include <QGraphicsView> #include <QGraphicsPathItem> #include <QDialog> +#include <QAbstractTableModel> namespace Ui{ class DivePlanner; @@ -13,6 +14,19 @@ class QListView; class QStringListModel; class QModelIndex; +class DivePlannerPointsModel : public QAbstractTableModel{ + Q_OBJECT +public: + static DivePlannerPointsModel* instance(); + enum Sections{DEPTH, DURATION, GAS, CCSETPOINT, COLUMNS}; + virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; +private: + explicit DivePlannerPointsModel(QObject* parent = 0); +}; + class Button : public QObject, public QGraphicsRectItem { Q_OBJECT public: |