diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-16 15:02:32 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-17 06:17:09 +0700 |
commit | 1f8078828663f6bfff768cbc2fb36e6643eb3d0e (patch) | |
tree | 93437eb965759cb6b08ce2b92b6568c81d4559e7 /qt-ui/profile/profilewidget2.h | |
parent | 9cb5ea45d886c15b26b196bc292b7a4bbf359b20 (diff) | |
download | subsurface-1f8078828663f6bfff768cbc2fb36e6643eb3d0e.tar.gz |
Added a DiveEventItem that knows how to handle itself.
Simply pass a event to the item and it will know what
to do. The sad part is that this isn't true yet - there's
quite a bit of boilerplate that a lot of the items are needing,
but the good part is that the boolerplate is the same in
all of the items, which means that I can create a tiny bit
of abstraction to encapsulate it and the code will be
way smaller to setup the items on the canvas.
Right now the items are being correctly placed on the
right places. It doesn't supports hidding / showing yet.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.h')
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index bea433fef..7d0e7189e 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -14,6 +14,8 @@ // * It needs to be dynamic, things should *flow* on it, not just appear / disappear. // */ #include "graphicsview-common.h" + +class DiveEventItem; struct DivePlotDataModel; struct DivePixmapItem; struct DiveRectItem; @@ -24,6 +26,7 @@ struct TimeAxis; struct dive; struct QStateMachine; struct DiveCartesianPlane; +struct plot_info; class ProfileWidget2 : public QGraphicsView { Q_OBJECT @@ -57,6 +60,10 @@ private: QStateMachine *stateMachine; DivePixmapItem *background ; + // All those here should probably be merged into one structure, + // So it's esyer to replicate for more dives later. + // In the meantime, keep it here. + struct plot_info *plotInfo; DepthAxis *profileYAxis ; DiveCartesianAxis *gasYAxis; TimeAxis *timeAxis; @@ -64,6 +71,7 @@ private: DiveRectItem *timeController; DiveProfileItem *diveProfileItem; DiveCartesianPlane *cartesianPlane; + QList<DiveEventItem*> eventItems; }; #endif
\ No newline at end of file |