From 74333963330cc5f9d8a848487522e34a822c46de Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 25 Jan 2016 17:48:57 -0200 Subject: Fix Ceiling Graph Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- profile-widget/diveprofileitem.cpp | 8 ++++++++ profile-widget/diveprofileitem.h | 1 + 2 files changed, 9 insertions(+) diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 986ecae23..b090d2173 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -116,6 +116,14 @@ void AbstractProfilePolygonItem::modelDataChanged(const QModelIndex &topLeft, co DiveProfileItem::DiveProfileItem() : show_reported_ceiling(0), reported_ceiling_in_red(0) { + connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::dcceilingChanged, this, &DiveProfileItem::settingsToggled); + connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::redceilingChanged, this, &DiveProfileItem::settingsToggled); +} + +void DiveProfileItem::settingsToggled(bool toggled) +{ + Q_UNUSED(toggled); + settingsChanged(); } void DiveProfileItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) diff --git a/profile-widget/diveprofileitem.h b/profile-widget/diveprofileitem.h index 0a009d01f..0c3f9a610 100644 --- a/profile-widget/diveprofileitem.h +++ b/profile-widget/diveprofileitem.h @@ -76,6 +76,7 @@ public: DiveProfileItem(); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex()); + void settingsToggled(bool toggled); virtual void settingsChanged(); void plot_depth_sample(struct plot_data *entry, QFlags flags, const QColor &color); int maxCeiling(int row); -- cgit v1.2.3-70-g09d2