PDA

View Full Version : qt4 & xp - QTextEdit length



incapacitant
6th March 2006, 15:56
Hello,

QTextEdit used to have a length() member that is gone. I cannot find any hint in the documentation about what to do in QT4.1.1.
What is the way to get the length of a QTextEdit widget ?

zlatko
6th March 2006, 16:00
Maiby txtEdit->toPlainText()->lenght() can help?
Or you mean max lenght that can be writed in text edit?

incapacitant
6th March 2006, 16:11
QString s;
s= qMessage->toPlainText();
int NbCharRestants = NbCharSMSMax - s->length();
s.setNum(NbCharRestants,10);
s = TxtCharSMSMax + " " + s;
model->setData(model->index(row, 0, QModelIndex()), s );


does not fix the problem, compile error on line 3 :
152 C:\Qt\test\sms\menu.cpp base operand of `->' has non-pointer type `QString'

incapacitant
6th March 2006, 16:22
I mean the length of the QTtext String afetr user input.

jacek
6th March 2006, 16:34
QString s;
...
int NbCharRestants = NbCharSMSMax - s->length();
Try:
int NbCharRestants = NbCharSMSMax - s.length();