PDA

View Full Version : QTextArea getting the current line of visible area(scroll)



ubuntudevelop78
26th November 2009, 07:19
Hello,

I am formatting a very long text in QTextArea, because of the size of the text my application is very slow,

so I am trying to format only the text that is about to be viewed by the user, but I don't know how to get only that part of the text:confused:

for example:

.
.
.
this is a very long text
this is a very long text
this is a very long text
____________________
| this is a very long text|
| this is a very long text|
| this is a very long text|<------a way to get only this part of the text
|___________________ |
this is a very long text
this is a very long text
.
.
.

Is it possible to get the range of text lines that will be rendered by QTextEdit?

I am using

ui->textEdit->verticalScrollBar()


but I don't know how to convert its current position to line number, I am just a beginner at QT programming.

Thank you.

Regards.