Line edit accept only alphanumeric characters, dash and underscore
I'm looking for the way to limit line edit to accept only alphanumeric characters, dash and underscore (in whole line could be only one dash and one underscore), without spaces. I was looking at RegExp, but then I left this option, because I found some blog post which is explaining that RegExp is really slow. Now I don't know what is best way to limit line edit, so the output would be like I want.
What do you recommend me?
Re: Line edit accept only alphanumeric characters, dash and underscore
Unless you are going to be filling a few thousand fields per second, you can safely use QRegExpValidator. Otherwise subclass QValidator and do the validation yourself.