diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-02-27 16:28:19 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-27 12:03:34 -0800 |
commit | 0a24e134696577dfc967f7e2ad1b4f0ab87740d6 (patch) | |
tree | 96129bb86afd665dcb434f0c0abd189ebd8b518d /qt-ui/profile/ruleritem.h | |
parent | 0d62efaa39388637dccf52cd432425dfdfc9a2d0 (diff) | |
download | subsurface-0a24e134696577dfc967f7e2ad1b4f0ab87740d6.tar.gz |
Remove the pInfo pointer, make it a real structure instead.
This fixes the invalid pointer stage crash.
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 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qt-ui/profile/ruleritem.h b/qt-ui/profile/ruleritem.h index 29b79231d..714bf09f9 100644 --- a/qt-ui/profile/ruleritem.h +++ b/qt-ui/profile/ruleritem.h @@ -5,6 +5,7 @@ #include <QGraphicsEllipseItem> #include <QGraphicsObject> #include "divecartesianaxis.h" +#include "display.h" struct plot_data; class RulerItem2; @@ -14,7 +15,7 @@ class RulerNodeItem2 : public QObject, public QGraphicsEllipseItem Q_OBJECT friend class RulerItem2; public: - explicit RulerNodeItem2(); + explicit RulerNodeItem2(struct plot_info& info); void setRuler(RulerItem2 *r); void recalculate(); @@ -22,7 +23,7 @@ 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; @@ -36,15 +37,16 @@ public: explicit RulerItem2(); void recalculate(); - void setPlotInfo(struct plot_info *pInfo); + void setPlotInfo(struct plot_info pInfo); RulerNodeItem2* sourceNode() const; RulerNodeItem2* destNode() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget * widget = 0); QRectF boundingRect() const; QPainterPath shape() const; + void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth); private: - struct plot_info *pInfo; + struct plot_info pInfo; QPointF startPoint, endPoint; RulerNodeItem2 *source, *dest; QString text; |