Hi, Jpn nearly give you the answer, I suggest you to find a tutorial on how using the Qt4 Assistant.
I'm in a good moon, I will explain you. 
QTextDocument * QTextEdit::document () const
To copy to clipboard, switch view to plain text mode
As you can see, this method return a QTextDocument* and as jpn said in his first reply, this class have the property you are looking for :
blockCount : const int
blockCount : const int
To copy to clipboard, switch view to plain text mode
Finishing with a little example (very little)
:
...
int i = textEdit->document()->blockCount();
...
...
QTextEdit *textEdit;
int i = textEdit->document()->blockCount();
...
To copy to clipboard, switch view to plain text mode
and i will contain the number of lines that textEdit contain. (more exactly the number of return, I mean an empty line is also counted)
Hope this will be enough ^^ and hope you will give more importance to the doc !!
Cheers.
Bookmarks