mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Fixed changing dates with the new date widget.
The maintab was connecting with an invalid slot on the new date widget, QDateTime instead of QDate Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1e2349e794
commit
81fd56b16f
2 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue