Summary: | KRestrictedLine needs API changes to support multi-char input (due to keyevent compression or input method events) | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Tomas Mecir <mecirt> |
Component: | general | Assignee: | Dario Andres <andresbajotierra> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | andresbajotierra, faure, justin.zobel, mlohse |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
patch
(Old) patch to use a QValidator |
Description
Tomas Mecir
2008-04-19 15:09:35 UTC
Created attachment 24405 [details]
patch
Attaching the patch as a file.
Any progress/info on this bug? I just encountered the same problem in my application. The patch works but the general implementation is not the best, as it can't filter out characters like "á" ('+a) as they aren't detected in the keyPressEvent I managed to write a better implementation that will work with every key using a custom QValidator. However it breaks the current behaviour of the "invalidChar(int)" signal as it returns a keycode, and such isn't possible when using the QValidator method I'm going to apply the patch until I can manage to improve the QValidator approach Regards SVN commit 966333 by darioandres: Fix the broken behaviour of KRestrictedLine (this needs a better implementation) BUG: 161012 M +3 -1 krestrictedline.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=966333 SVN commit 966335 by darioandres: Backport to 4.2branch of: SVN commit 966333 by darioandres: Fix the broken behaviour of KRestrictedLine (this needs a better implementation) CCBUG: 161012 M +3 -1 krestrictedline.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=966335 Reopening as this is not fully fixed. (but it should work as the older versions) SVN commit 1014077 by dfaure: Fix KRestrictedLine to not let composed characters like éèú etc. go through, if they're not wanted. And add test code for KRestrictedLine in klineedittest. But with possible event compression in keyPressEvent and the way inputMethodEvent works, we really get QStrings as input, not "int key" like the API assumes here. So we should really use a validator instead, so we can remove unwanted chars and keep the others, which means a different signal signature. Dario, can you commit your validator, commented out, for kde5? :-) CCBUG: 161012 M +22 -1 tests/klineedittest.cpp M +6 -1 tests/klineedittest.h M +38 -20 widgets/krestrictedline.cpp M +3 -3 widgets/krestrictedline.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1014077 Created attachment 36616 [details]
(Old) patch to use a QValidator
The patch it is a bit old and I have already discovered some errors (small style issues), the invalidChar signal not being connected properly. But that can wait for KDE5.
Thanks for the report Tomas. Are you able to confirm if this is still an issue when building using KRestricedLine, thanks. Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone! |