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.

Qt Code:
  1. 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 :
Qt Code:
  1. blockCount : const int
To copy to clipboard, switch view to plain text mode 

Finishing with a little example (very little) :
Qt Code:
  1. ...
  2. QTextEdit *textEdit;
  3. int i = textEdit->document()->blockCount();
  4. ...
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.