PDA

View Full Version : Is it possible to set a maximum length for QTextEdit ???



vairamuthu.g
27th August 2010, 18:08
Hello folks,

Is it possible to set a maximum length for QTextEdit....?

We have setMaxLength method for QLineEdit... I need a similar functionality for QTextEdit.

Regards

Urthas
28th August 2010, 05:17
Perhaps you could connect the QTextEdit::textChanged() signal to a slot that keeps count of how many characters there are and calls setEnabled(false) or something like that when the counter's value exceeds some threshold.