-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validate math formula on text change #287
validate math formula on text change #287
Conversation
There are two options for this: On user and programmatic change
On user change only
|
I've learned to look at the OK button to see if validation is good or not. Maybe something in the field or beside the field instead would be a better/more coupled indicator? |
Thanks, I think some early validation (and possibly also indicating what the problem is if it fails) is a good idea. Most likely I will checkout this PR locally, add some error indicator and then merge this (unless you want to take this on as well) |
I added a red background on validation fail to the box and a green on OK. Doesn't look too great. Maybe lighter red and green or some kind of X or checkmark. I can add what I've tried to the branch |
Oh interesting!
Yeah. That is true. I hadn't looked into displaying the parser errors I went for background colors. I broke the formula saving though. Hahaha. Nuked a line I didn't want to
|
I think I'll just merge the original PR + my changes to show the error message. The colors are a nice touch, but I think the error message is more helpful.
You just deleted the line which initially fills the QLineEdit with the formula from the trace when opening the dialog. |
I've been writing a lot of formulae and I am new to the software and not sure about syntax. I've been clicking out of the input box to validate. Looks like I could also be pressing enter. It would be nice if this field was validated as I typed instead and so I have opened this draft pull request.
Validation will run on each change with no delay/debounce. Fiddled around with it a bit and didn't seem super heavy. Don't think there are additional side effects but I am not familiar with the codebase.