Hi,
Can anyone please tell me how to set the maximum limit in textEdit boxes.
Suppose I have a textEdit box which should accept only 2 characters or numbers.
How to do it.
With Kind
Regards
Kenny
Hi,
Can anyone please tell me how to set the maximum limit in textEdit boxes.
Suppose I have a textEdit box which should accept only 2 characters or numbers.
How to do it.
With Kind
Regards
Kenny
Use a QLineEdit, and use QLineEdit::setMaxLength() to restrict the length of the contents.
Edit: Furthermore, you can also use QLineEdit::inputMask property to restrict the content to some specific characters.
Last edited by jpn; 28th February 2007 at 10:38. Reason: updated contents
J-P Nurmi
Will this work for TextEdit;
I havnt seen a property for Text Edit like this.
Why do you need a QTextEdit if you want to allow only two characters?
Bookmarks