diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-15 12:23:40 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-16 10:12:30 +0700 |
commit | 93d464fcb77690d1c63f67332ab9d4727d869304 (patch) | |
tree | 00b59de8951b4000fb712f958a28d1933c81e0e3 /qt-ui | |
parent | b50ae8700746f172350611b088e9f0d761768680 (diff) | |
download | subsurface-93d464fcb77690d1c63f67332ab9d4727d869304.tar.gz |
Setup the default icon sizes and locations.
Setup the default item sizes and locations inside of the QGraphicsScene.
Also added every item to the scene so that it's correctly displayed on
screen.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ec832f9a8..c32feb62c 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -4,6 +4,7 @@ #include "diverectitem.h" #include "divecartesianaxis.h" #include "diveprofileitem.h" +#include "helpers.h" #include <QStateMachine> ProfileWidget2::ProfileWidget2(QWidget *parent) : @@ -33,6 +34,32 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : profileYAxis->setOrientation(Qt::Vertical); gasYAxis->setOrientation(Qt::Vertical); timeAxis->setOrientation(Qt::Horizontal); + + // Defaults of the Axis Coordinates: + profileYAxis->setMinimum(0); + profileYAxis->setTickInterval(M_OR_FT(10,30)); //TODO: This one should be also hooked up on the Settings change. + timeAxis->setMinimum(0); + timeAxis->setTickInterval(600); // 10 to 10 minutes? + + // Default Sizes of the Items. + profileYAxis->setLine(0, 0, 0, 90); + profileYAxis->setX(2); + profileYAxis->setTickSize(1); + gasYAxis->setLine(0, 0, 0, 20); + timeAxis->setLine(0,0,96,0); + timeAxis->setX(3); + timeAxis->setTickSize(1); + depthController->setRect(0, 0, 10, 5); + timeController->setRect(0, 0, 10, 5); + timeController->setX(sceneRect().width() - timeController->boundingRect().width()); // Position it on the right spot. + + // insert in the same way it's declared on the Enum. This is needed so we don't use an map. + QList<QGraphicsItem*> stateItems; stateItems << background << profileYAxis << gasYAxis + << timeAxis << depthController << timeController; + Q_FOREACH(QGraphicsItem *item, stateItems){ + scene()->addItem(item); + } + } // Currently just one dive, but the plan is to enable All of the selected dives. |