diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-03-07 12:08:31 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-07 08:53:14 -0800 |
commit | 6dec4b055601526a0c8bf9e45dfe0ff648d80489 (patch) | |
tree | b7c2207f2e6b0e218beb9e8e53fad779adb97498 /qt-ui/profile/ruleritem.h | |
parent | 80341062195b27ea2f6d16ef22225b439ac84165 (diff) | |
download | subsurface-6dec4b055601526a0c8bf9e45dfe0ff648d80489.tar.gz |
Fix a crash on changing dives when the ruler is used.
The ruler is a weird beast - it has two child objects that access the
parent to call another function, that call the child functions.
When I updated the plot_info I didn't take that into consideration, what
happened is that when I set the parent's plot_info, the children's
plot_info are still invalid, but the update method is called anyhow.
This patch updates all plot_info's before calling anything else.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/ruleritem.h')
-rw-r--r-- | qt-ui/profile/ruleritem.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/profile/ruleritem.h b/qt-ui/profile/ruleritem.h index f2ff61c09..61eda1ed3 100644 --- a/qt-ui/profile/ruleritem.h +++ b/qt-ui/profile/ruleritem.h @@ -15,15 +15,16 @@ class RulerNodeItem2 : public QObject, public QGraphicsEllipseItem { friend class RulerItem2; public: - explicit RulerNodeItem2(struct plot_info &info); + explicit RulerNodeItem2(); void setRuler(RulerItem2 *r); + void setPlotInfo(struct plot_info& info); void recalculate(); protected: QVariant itemChange(GraphicsItemChange change, const QVariant &value); private: - struct plot_info &pInfo; + struct plot_info pInfo; struct plot_data *entry; RulerItem2 *ruler; DiveCartesianAxis *timeAxis; |