summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_base.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-29 23:02:13 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-06-15 11:07:15 -0700
commit1641147e7b77db69f829cf9b41de4c313d45e3ed (patch)
treecdca626fe8e3700b07636ac473e0c3e11be01107 /desktop-widgets/command_base.h
parentcdb3bcb1a641e27cf157530bf637ee4a9851b401 (diff)
downloadsubsurface-1641147e7b77db69f829cf9b41de4c313d45e3ed.tar.gz
Undo: don't create spurious undo commands for temperature fields
When tabbing through the dive-info fields we get *EditingFinished signals. This would create undo commands. The undo commands should recognize if nothing changed. But for the temperature fields, owing to rounding, an unchanged text could actually represent a different value. This would lead to very confusing situations: 1) Edit air temperature 2) Press tab to finish editing 3) Focus goes to water temperature 4) Try to undo change in menu 5) When opening the menu water temperature loses focus 6) Water temperature is edited 7) Undo undos the water temperature, not the air temperature 8) Goto 4 Fortunately, QLineEdit fields have the isModified() member function that returns true if the field was changed by the user. Use this to prevent this case. This is not a general method, i.e. it has to applied to every field with that problem. But it is less intrusive than subclassing the QLineEdit class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_base.h')
0 files changed, 0 insertions, 0 deletions