summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-02-07 14:59:58 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-08 07:16:16 -0800
commit9cf6b2be6bc8f49e4e26e0d10a7d9d48afcdc05a (patch)
treec462f0bf85e20da492a62903f8abc7f3a00a75b4 /qt-ui/profile/profilewidget2.h
parent6de9b329d16275573d2e8f2ea6e712c626553dad (diff)
downloadsubsurface-9cf6b2be6bc8f49e4e26e0d10a7d9d48afcdc05a.tar.gz
Break everything to make it correct next time.
This commit breaks the whole new profile. <3 The problem with the old code is that I was using the QStateMachine and I just got tired of it. I will implement a much-simpler state machine to do what I want instead of hitting my head on the wall to understand how that was supposed to work. This commit also adds a few helper methods to simplify the understanding of the constructor and tries to make the logic a bit better. No graphics are being show right now. :) 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.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h
index 237fc21b5..088e33f8c 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -46,6 +46,10 @@ class ProfileWidget2 : public QGraphicsView {
Q_OBJECT
void fixBackgroundPos();
void scrollViewTo(const QPoint& pos);
+ void setupSceneAndFlags();
+ void setupItemSizes();
+ void addItemsToScene();
+ void setupItemOnScene();
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};
@@ -58,7 +62,6 @@ public:
public slots: // Necessary to call from QAction's signals.
void settingsChanged();
protected:
- virtual void contextMenuEvent(QContextMenuEvent* event);
virtual void resizeEvent(QResizeEvent* event);
virtual void wheelEvent(QWheelEvent* event);
virtual void mouseMoveEvent(QMouseEvent* event);
@@ -69,7 +72,6 @@ signals:
private:
DivePlotDataModel *dataModel;
State currentState;
- QStateMachine *stateMachine;
int zoomLevel;
DivePixmapItem *background ;
ToolTipItem *toolTipItem;