aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-02-04 21:47:50 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-05 06:30:33 -0800
commita649bcc7bc0006cc78ac547716d8bebf8b63267c (patch)
tree6cf8274a85e6210c26a20a3e743819824f95a81d /qt-ui/profile/profilewidget2.h
parentdc077e7bffa6a5236a5b6437ef64237e30980d9d (diff)
downloadsubsurface-a649bcc7bc0006cc78ac547716d8bebf8b63267c.tar.gz
Added Mouse based Zoom / Movement.
This patch uses the same code that lubomir used on the old profile. It strangely didn't worked - most probably because the scene has a fixed width() and height() of 100. the zoom works, and the movement works, but only on the 100 first pixels of the profile. 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.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h
index df4a844bd..a89cef786 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -43,6 +43,7 @@ struct PartialGasPressureAxis;
class ProfileWidget2 : public QGraphicsView {
Q_OBJECT
void fixBackgroundPos();
+ void scrollViewTo(const QPoint& pos);
public:
enum State{ EMPTY, PROFILE, EDIT, ADD, PLAN, INVALID };
enum Items{BACKGROUND, PROFILE_Y_AXIS, GAS_Y_AXIS, TIME_AXIS, DEPTH_CONTROLLER, TIME_CONTROLLER, COLUMNS};
@@ -55,6 +56,8 @@ public slots: // Necessary to call from QAction's signals.
protected:
virtual void contextMenuEvent(QContextMenuEvent* event);
virtual void resizeEvent(QResizeEvent* event);
+ virtual void wheelEvent(QWheelEvent* event);
+ virtual void mouseMoveEvent(QMouseEvent* event);
signals:
void startProfileState();
@@ -70,7 +73,7 @@ private:
DivePlotDataModel *dataModel;
State currentState;
QStateMachine *stateMachine;
-
+ int zoomLevel;
DivePixmapItem *background ;
// All those here should probably be merged into one structure,
// So it's esyer to replicate for more dives later.