It's possible to prevent the insertion of some specific character in the QTextEdit widget?
It's possible to prevent the insertion of some specific character in the QTextEdit widget?
have a look at QValidator
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
As far as I know QValidator is best used with a line edit. For a text edit you have to catch the key press events and filter there. An easy solution is not available. Only if you dealing with small text you can use the text changed signal and perform replace/remove instructions on the whole text.
Sorry, for some reason my brain interpreted QTextEdit as QLineEdit.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks