diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2018-06-17 20:22:55 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-06-18 15:08:27 +0900 |
commit | 0a3fe87f54170f7814efbf3a4c5faf3eab7d8cba (patch) | |
tree | 1e09e51516d85607135a426bcb6982ba07872433 /desktop-widgets/simplewidgets.cpp | |
parent | 2ae3760303c7a5666a7a23b5d41ad09d4963c85a (diff) | |
download | subsurface-0a3fe87f54170f7814efbf3a4c5faf3eab7d8cba.tar.gz |
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 <sfuchs@gmx.de>
Diffstat (limited to 'desktop-widgets/simplewidgets.cpp')
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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() |