Subject: | Needs discussion: Date/Time Slot Value "Auto-Apply" on Hitting Enter [Gnats 5266] |
---|---|
Date: | Tue, 12 Mar 2013 15:39 |
From: | Phil Weinstein |
To: David and Edie; CC: Software
David suggested that we talk about this before proceeding with a change for this bug.
It's turning out to be difficult, and would require appreciable additional complexity, to discern whether or not the entered text had been valid at the time of our receiving the "Enter" (or "Return") key-pressed notification.
- If the text represents a valid date/time, that value is applied to the selected slot values.
- If the text is invalid, a "beep" is sounded, and the value is _not_ applied to slot values.
Note: There is one bug I have a fix for which I'd like to apply. When the user enters an invalid Date/Time into this spinner, instead of reverting back to its prior value, it puts in the timestep corresponding to the CURRENT (wall clock) time. Clearly that's a bug.Technical: The underlying Qt Spinner widget (QSpinBox) is an integer spinner which supports translation to and from application-level strings (i.e. our Date/Time formats) through subclassing and overriding virtual methods. In the course the spinner's base class (QAbstractSpinbox) processing of the Enter key, it interprets and refreshes the display value. (It does go through our code, but we don't have a way of knowing that it is processing the Enter key press). By the time we receive "our" Enter key press notification, the fixup has already occurred.