From 0a3fe87f54170f7814efbf3a4c5faf3eab7d8cba Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sun, 17 Jun 2018 20:22:55 +0200 Subject: [PATCH] In dive picture shift time dialog suppress double triggering of timeEdit In dive picture shift time dialog when pressing the up or down arrow of the timeEdit widged there is some risk of double triggering because the function called after this UI action ("updateInvalid()") can have quite some runtime. Suppress any potential double triggering by disabling the timeEdit widget after each change until the code is processed. Signed-off-by: Stefan Fuchs --- desktop-widgets/simplewidgets.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 0f22ff377..9866925ef 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -412,10 +412,15 @@ void ShiftImageTimesDialog::updateInvalid() void ShiftImageTimesDialog::timeEditChanged(const QTime &time) { + QDateTimeEdit::Section timeEditSection = ui.timeEdit->currentSection(); + ui.timeEdit->setEnabled(false); m_amount = time.hour() * 3600 + time.minute() * 60; if (ui.backwards->isChecked()) m_amount *= -1; updateInvalid(); + ui.timeEdit->setEnabled(true); + ui.timeEdit->setFocus(); + ui.timeEdit->setSelectedSection(timeEditSection); } void ShiftImageTimesDialog::timeEditChanged()