diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/maintab.cpp | 2 | ||||
-rw-r--r-- | qt-ui/maintab.h | 1 | ||||
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 9 | ||||
-rw-r--r-- | qt-ui/profile/diveprofileitem.h | 4 |
4 files changed, 15 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 4f253e150..7b052e984 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -978,6 +978,7 @@ void MainTab::on_dateEdit_dateChanged(const QDate &date) dateTime.setTimeSpec(Qt::UTC); dateTime.setDate(date); DivePlannerPointsModel::instance()->getDiveplan().when = displayed_dive.when = dateTime.toTime_t(); + emit dateTimeChanged(); } void MainTab::on_timeEdit_timeChanged(const QTime &time) @@ -989,6 +990,7 @@ void MainTab::on_timeEdit_timeChanged(const QTime &time) dateTime.setTimeSpec(Qt::UTC); dateTime.setTime(time); DivePlannerPointsModel::instance()->getDiveplan().when = displayed_dive.when = dateTime.toTime_t(); + emit dateTimeChanged(); } // changing the tags on multiple dives is semantically strange - what's the right thing to do? diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index 93bb1c949..47e57c2b0 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -53,6 +53,7 @@ public: signals: void addDiveFinished(); + void dateTimeChanged(); public slots: diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 10fb626b6..1e7a5b535 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -11,6 +11,7 @@ #include "helpers.h" #include "diveplanner.h" #include "libdivecomputer/parser.h" +#include "mainwindow.h" #include <QPen> #include <QPainter> @@ -675,6 +676,7 @@ DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientF gradientFactor->setY(0); gradientFactor->setBrush(getColor(PRESSURE_TEXT)); gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); + connect(MainWindow::instance()->information(), SIGNAL(dateTimeChanged()), this, SLOT(recalc())); settingsChanged(); } @@ -757,11 +759,16 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo setBrush(pat); } +void DiveCalculatedCeiling::recalc() +{ + dataModel->calculateDecompression(); +} + void DiveCalculatedCeiling::settingsChanged() { if (dataModel && is3mIncrement != prefs.calcceiling3m) { // recalculate that part. - dataModel->calculateDecompression(); + recalc(); } is3mIncrement = prefs.calcceiling3m; setVisible(prefs.calcceiling); diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index 300e4b265..86e90224a 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -162,6 +162,10 @@ public: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); virtual void settingsChanged(); +public +slots: + void recalc(); + private: bool is3mIncrement; DiveTextItem *gradientFactor; |