Thanks for the review. I made it a little more tolerant if editing existing values instead of giving red while deleting it at some point -after deleting the Unit and after last number after the '.'- then back to normal yellow and for empty string -or should I leave it marked red for empty string?- which made it more consistent for the user.
Waiting for the review. Regards, Yousef Hamza On Sat, Apr 12, 2014 at 6:02 PM, Miika Turkia <[email protected]>wrote: > On Sat, Apr 12, 2014 at 6:04 PM, Yosef Hamza <[email protected]> wrote: > >> As a warining for the user mark the field red. >> if user inputs invaild input that will be ignored >> while parsing. >> > > The pattern matching is a bit broken. E.g. following input for temperature > is accepted: > 2 8.5°C fff asfdf , > > If the input contains ° or , characters, then it is accepted, no matter > what else is in it. I would go for a single regexp pattern that includes > all valid inputs. Something like this: > > if > (!text.contains(QRegExp("^[-+]{0,1}[0-9]+([,.][0-9]+){0,1}(°[CF]){0,1}$"))) > { > > This matches the full input field and allows optionally different parts of > temperature to be given. I am not sure if the unit makes sense after the > degree sign, as it is not parsed but the configured unit is used instead. > > miika >
0001-Mark-Air-Water-temp-field-red-for-wrong-input.patch
Description: Binary data
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
