From a455b32e0241ac6928293005ede8e2d79220533d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 25 Jan 2019 22:11:30 +0100 Subject: Filter: implement reset filter Move initialization to a separate function and connect that to the reset button. Two points of note: 1) Reseting the text-fields causes signals. Thus, signals have to be ignored during reset. Do this with a new flag. 2) To make reset of the from-date work, the from-date has to be initialized to a distinct value. Setting a default-constructed QDateTime leaves the widget unchanged. Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index faaae8c2f..7ef50df92 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -27,8 +27,8 @@ struct FilterData { double maxWaterTemp = 200; double minAirTemp = -50; double maxAirTemp = 200; - QDateTime fromDate; - QTime fromTime; + QDateTime fromDate = QDateTime(QDate(1980,1,1)); + QTime fromTime = QTime(0,0); QDateTime toDate = QDateTime::currentDateTime(); QTime toTime = QTime::currentTime(); QStringList tags; -- cgit v1.2.3-70-g09d2