To fantalin :
int r = textEdit.textCursor().blockNumber();打印一直为o
int r = ui.textEdit.document().blockCount();打印一直为1
文档上说在textEdit中是无效的,不知我的理解对么
Returns the number of the block the cursor is in, or 0 if the cursor is invalid.
Note that this function only makes sense in documents without complex objects such as tables or frames.
[ 此贴被lazybone在2008-12-25 11:25重新编辑 ]