diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-21 17:34:36 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-21 14:25:09 -0800 |
commit | b08da94007d7a2e71f932bff67750051c1ad5d65 (patch) | |
tree | 7ff718ee33a9826e9ff071f5c2ddc744f07705cc /qt-ui/profile/profilewidget2.cpp | |
parent | 8831bf6350cc2836803c7a8e0afce96727a88964 (diff) | |
download | subsurface-b08da94007d7a2e71f932bff67750051c1ad5d65.tar.gz |
Draw the Ceiling in red if preferences are marked for that.
This code actually uses the preferences for something. It will show and
hide the calculated ceiling in red if the prefrerences are changed for
that. One bad thing that I did in this commit ( so it was easy to try ) is
that a preference change will redraw the whole graph - not optimized. I'll
make this better in a later commit so that only the affected items will be
redrawn.
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.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 790b2c611..b5610e4cf 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -39,7 +39,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : cartesianPlane(new DiveCartesianPlane()), meanDepth(new DiveLineItem()), diveComputerText(new DiveTextItem()), - diveCeiling(NULL) + diveCeiling(NULL), + reportedCeiling(NULL) { setScene(new QGraphicsScene()); scene()->setSceneRect(0, 0, 100, 100); @@ -386,6 +387,18 @@ void ProfileWidget2::plotDives(QList<dive*> dives) allTissues.append(tissueItem); scene()->addItem(tissueItem); } + + if(reportedCeiling){ + scene()->removeItem(reportedCeiling); + delete reportedCeiling; + } + reportedCeiling = new DiveReportedCeiling(); + reportedCeiling->setHorizontalAxis(timeAxis); + reportedCeiling->setVerticalAxis(profileYAxis); + reportedCeiling->setModel(dataModel); + reportedCeiling->setVerticalDataColumn(DivePlotDataModel::CEILING); + reportedCeiling->setHorizontalDataColumn(DivePlotDataModel::TIME); + scene()->addItem(reportedCeiling); emit startProfileState(); } |