PDA

View Full Version : How to limit the input text in QPlaintextedit?



sudhansu
10th March 2010, 09:44
Hi all
I've a Qplaintextedit object. I need the input text limit should be 1000. How to do it?
i tried with maximumBlockCount(1000) but it didnt help as it will limit blockas only.

toutarrive
10th March 2010, 10:06
Limit the QPlaintextedit width, compute the number of characters going into one line before line wrap and then you can setMaximumBlockCount( number of lines for 1000 characters).

sudhansu
10th March 2010, 10:14
Limit the QPlaintextedit width, compute the number of characters going into one line before line wrap and then you can setMaximumBlockCount( number of lines for 1000 characters).


can u plz tell me how to do it programeticaaly? width of plaintextedit is 381.

wagmare
10th March 2010, 10:16
Hi all
I've a Qplaintextedit object. I need the input text limit should be 1000. How to do it?
i tried with maximumBlockCount(1000) but it didnt help as it will limit blockas only.

means u want to limit the input entry below 1000 ..? if so use QValidator ..http://doc.trolltech.com/3.3/qvalidator.html

sudhansu
10th March 2010, 10:42
means u want to limit the input entry below 1000 ..? if so use QValidator ..http://doc.trolltech.com/3.3/qvalidator.html

how to use QValidator with QPlaintextedit???