I have a QLineEdit, on which I have set a QRegExpValidator, that allows the user to input only one whitespace between words.
Now I want that whenever the user tries to enter more than one whitespaces, the tooltip of the QLineEdit should show up, but I’m not getting any method to implement it.
Thanx 🙂
It seems there is no direct method to perform what you want. One way to do above is to handle
QLineEdit‘stextChanged()signal. Then you can check that string against your regular expression usingQRegExp::exactMatch()function and if it don’t match then show tooltip.Connect the signal..
Here your slot goes..