[Qt-interest] Go to line QPlainText

Daniel Hedberg daniel.hedberg at mathcore.com
Fri Dec 11 17:07:33 CET 2009


Hi,

Take a look at the following functions:

QPlainText::document
QTextDocument::findBlockByLineNumber
QTextBlock::position
QPlaintext::textCursor
QTextCursor::setPosition
QPlaintext::setTextCursor

They provide everything you need.

Best Regards,
Daniel Hedberg



-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of matteo
Sent: den 11 december 2009 14:02
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Go to line QPlainText

Probably I not explain correctly my problem.
I need to go at n-th line of my Text. I must implemente the function
GoToLine(const int lineNumber)
{
}
Thanks
Teo

Bastian Bense wrote:
> Try
> 
> myPlainTextEdit->moveCursor(QTextCursor::Start);
> myPlainTextEdit->ensureCursorVisible();
> 
> 
> Am 11.12.2009 um 12:07 schrieb matteo:
> 
> 
>>Ii need to go directly at beginning of a line of a PlainText.
>>I should use moveCursor n-th times. Is ther a directly and faster 
>>possibility?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list