summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-21 10:48:26 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-21 09:38:46 -0800
commitcaba6500d63e6081565aebd9e872e48b049e5d03 (patch)
tree08038ec0647165ff208a9b8cc68f38a5b61f1267 /qt-ui/profile/profilewidget2.cpp
parent63c1a1b3e9e631338bca59d45a21e67027799abc (diff)
downloadsubsurface-caba6500d63e6081565aebd9e872e48b049e5d03.tar.gz
Add the dive computer text.
Added the dive computer text on the bottom left side of the new Profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 6fc5dd565..34b87ad78 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -7,7 +7,7 @@
#include "helpers.h"
#include "profile.h"
#include "diveeventitem.h"
-
+#include "divetextitem.h"
#include <QStateMachine>
#include <QSignalTransition>
#include <QPropertyAnimation>
@@ -37,7 +37,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
temperatureItem(NULL),
gasPressureItem(NULL),
cartesianPlane(new DiveCartesianPlane()),
- meanDepth(new DiveLineItem())
+ meanDepth(new DiveLineItem()),
+ diveComputerText(new DiveTextItem())
{
setScene(new QGraphicsScene());
scene()->setSceneRect(0, 0, 100, 100);
@@ -92,10 +93,13 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
cartesianPlane->setLeftAxis(profileYAxis);
scene()->addItem(cartesianPlane);
+ diveComputerText->setAlignment(Qt::AlignLeft | Qt::AlignTop);
+ diveComputerText->setBrush(getColor(TIME_TEXT));
+
// 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 <<
- temperatureAxis << cylinderPressureAxis <<
+ temperatureAxis << cylinderPressureAxis << diveComputerText <<
meanDepth;
Q_FOREACH(QGraphicsItem *item, stateItems) {
scene()->addItem(item);
@@ -354,6 +358,9 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
gasPressureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
scene()->addItem(gasPressureItem);
+ diveComputerText->setText(currentdc->model);
+ diveComputerText->setPos(1 , sceneRect().height());
+
emit startProfileState();
}