diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-11 13:54:17 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-11 13:55:51 -0700 |
commit | c4aa1f542ccbbbdc78dd3d44fe08f6410b9a5d2c (patch) | |
tree | 0bf8d71fc1e4ccca5943f94693ad46c484d796dd /qt-ui/profile | |
parent | 397e39eb4fb006dfc2fda80c482c03045f6a9ac9 (diff) | |
download | subsurface-c4aa1f542ccbbbdc78dd3d44fe08f6410b9a5d2c.tar.gz |
Profile: add a flag to force redrawing the profile
This is needed if something has changed that requires a redraw, but the
plotDives() function can't tell (for example when a dive computer has been
deleted and there's now a different DC in the same spot, with the same
number - see next commit).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 5 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 6de0e1f79..681878d0c 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -69,6 +69,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), backgroundFile(":poster"), toolTipItem(new ToolTipItem()), isPlotZoomed(prefs.zoomed_plot), + forceReplot(false), profileYAxis(new DepthAxis()), gasYAxis(new PartialGasPressureAxis()), temperatureAxis(new TemperatureAxis()), @@ -401,9 +402,11 @@ void ProfileWidget2::plotDives(QList<dive *> dives) // showing (can't compare the dive pointers as those might change). // I'm unclear what the semantics are supposed to be if we actually // use more than one 'dives' as argument - so ignoring that right now :-) - if (d->id == dataModel->id() && dc_number == dataModel->dcShown()) + if (d->id == dataModel->id() && dc_number == dataModel->dcShown() && + !forceReplot) return; + forceReplot = false; if (currentState == EMPTY) setProfileState(); diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 7d55fe5d0..f908543d1 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -131,6 +131,7 @@ private: QString backgroundFile; ToolTipItem *toolTipItem; bool isPlotZoomed; + bool forceReplot; // All those here should probably be merged into one structure, // So it's esyer to replicate for more dives later. // In the meantime, keep it here. |