diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-04 16:12:43 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-04 16:12:43 -0300 |
commit | 243016633d31f8225fc4d1475463cd0477cf9505 (patch) | |
tree | c553d4eb99b188a935d49f54faf27467091eb49a /qt-ui/profilegraphics.h | |
parent | fcd6903621da975a83bfb6c9a9769221c4203ad9 (diff) | |
download | subsurface-243016633d31f8225fc4d1475463cd0477cf9505.tar.gz |
Started the code for the Profile Plotting
This small patch adds a new class - ProfileGraphicsView
it's a QGraphicsView based class that will holds all
graphics-items for the plotting.
The setup is simple, just call ui->ListView->plot( dive ) ( that's
already a ProfileGraphicsView and magic will happen.
Since Im using a QGraphicsView , the size of the canvas doesn't
matter and I'm fixing it at 0,0,100,100. when a resize is done,
the resizeEvent will be called, fitting the scene's rectangle on
the view.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/profilegraphics.h')
-rw-r--r-- | qt-ui/profilegraphics.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qt-ui/profilegraphics.h b/qt-ui/profilegraphics.h new file mode 100644 index 000000000..e3380abcd --- /dev/null +++ b/qt-ui/profilegraphics.h @@ -0,0 +1,17 @@ +#ifndef PROFILEGRAPHICS_H +#define PROFILEGRAPHICS_H + +#include <QGraphicsView> + +class ProfileGraphicsView : public QGraphicsView { +Q_OBJECT +public: + ProfileGraphicsView(QWidget* parent = 0); + void plot(struct dive *d); + +protected: + void resizeEvent(QResizeEvent *event); + +}; + +#endif |