-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: prevent selection of suffix text in preferences spinboxes #3842
base: main
Are you sure you want to change the base?
Conversation
Thank you for taking the time to contribute! I'm a bit nervous about unintended regressions here - it's a fairly unimportant issue, and any change can introduce unintended breakage. For example, we now get these errors when closing Anki: Error in sys.excepthook: Original exception was: |
Sorry, I'm not completely familiar how Qt's types work and I think I misinterpreted how a certain function is called. I corrected the error you mentioned by properly testing the types of the objects I use in the event filter function. I wrongly assumed that I could cast them instead... Thank you for pointing that out! I know that it's not a priority fix, I just wanted to start contributing to Anki with something small. I understand your concerns about introducing unnecessary change. |
(see issue #3802)
It was done by adding to the spinboxes an event filter that checks whether the selection or cursor are in a valid state.
I hope that I correctly followed the contribution guidelines regarding type hints. I had to cast some of the objects to pass the ninja mypy tests.