diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/maintab.cpp | 10 | ||||
-rw-r--r-- | qt-ui/maintab.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 15759d7ec..d46f364fb 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -948,13 +948,14 @@ void MainTab::validate_temp_field(QLineEdit *tempField, const QString &text) } } -void MainTab::on_dateEdit_dateChanged(const QDateTime &datetime) +void MainTab::on_dateEdit_dateChanged(const QDate &date) { if (editMode == NONE) return; - QDateTime dateTimeUtc(datetime); - dateTimeUtc.setTimeSpec(Qt::UTC); - editedDive.when = dateTimeUtc.toTime_t(); + QDateTime dateTime = QDateTime::fromTime_t(editedDive.when); + dateTime.setTimeSpec(Qt::UTC); + dateTime.setDate(date); + editedDive.when = dateTime.toTime_t(); markChangedWidget(ui.dateEdit); } @@ -963,6 +964,7 @@ void MainTab::on_timeEdit_timeChanged(const QTime &time) if (editMode == NONE) return; QDateTime dateTime = QDateTime::fromTime_t(editedDive.when); + dateTime.setTimeSpec(Qt::UTC); dateTime.setTime(time); editedDive.when = dateTime.toTime_t(); markChangedWidget(ui.timeEdit); diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index 1e7b5d3a3..f20af8477 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -68,7 +68,7 @@ slots: void on_airtemp_textChanged(const QString &text); void on_watertemp_textChanged(const QString &text); void validate_temp_field(QLineEdit *tempField, const QString &text); - void on_dateEdit_dateChanged(const QDateTime &datetime); + void on_dateEdit_dateChanged(const QDate &date); void on_timeEdit_timeChanged(const QTime & time); void on_rating_valueChanged(int value); void on_visibility_valueChanged(int value); |