diff options
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 752644e27..ec832f9a8 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1,7 +1,38 @@ #include "profilewidget2.h" - -ProfileWidget2::ProfileWidget2(QWidget *parent) +#include "diveplotdatamodel.h" +#include "divepixmapitem.h" +#include "diverectitem.h" +#include "divecartesianaxis.h" +#include "diveprofileitem.h" +#include <QStateMachine> + +ProfileWidget2::ProfileWidget2(QWidget *parent) : + QGraphicsView(parent), + dataModel(new DivePlotDataModel(this)), + currentState(INVALID), + stateMachine(new QStateMachine(this)), + background (new DivePixmapItem()), + profileYAxis(new DepthAxis()), + gasYAxis(new DiveCartesianAxis()), + timeAxis(new TimeAxis()), + depthController(new DiveRectItem()), + timeController(new DiveRectItem()), + diveProfileItem(new DiveProfileItem()) { + setScene(new QGraphicsScene()); + scene()->setSceneRect(0, 0, 100, 100); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scene()->setItemIndexMethod(QGraphicsScene::NoIndex); + setOptimizationFlags(QGraphicsView::DontSavePainterState); + setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); + setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform); + + // Creating the needed items. + // ORDER: {BACKGROUND, PROFILE_Y_AXIS, GAS_Y_AXIS, TIME_AXIS, DEPTH_CONTROLLER, TIME_CONTROLLER, COLUMNS}; + profileYAxis->setOrientation(Qt::Vertical); + gasYAxis->setOrientation(Qt::Vertical); + timeAxis->setOrientation(Qt::Horizontal); } // Currently just one dive, but the plan is to enable All of the selected dives. |