Moveto perticular leine in QTextDocument
How can i move to perticular line or get the x and y position of a perticular line of QTextDocument.
Re: Moveto perticular leine in QTextDocument
Quote:
Originally Posted by
bismitapadhy
How can i move to perticular line
You can use :
Quote:
Originally Posted by
bismitapadhy
get the x and y position of a perticular line of QTextDocument.
Try:
Code:
QTextDocument::findBlockByLineNumber(int lineNumber
).
layout()->position
();
Re: Moveto perticular leine in QTextDocument
Quote:
Originally Posted by
yogeshgokul
You can use :
Try:
Code:
QTextDocument::findBlockByLineNumber(int lineNumber
).
layout()->position
();
In Qt 4.3.0 there is no function like FindBlockByLineNumber(int LineNo)
Please give me any other solution to findout.
Re: Moveto perticular leine in QTextDocument
Quote:
Originally Posted by
bismitapadhy
In Qt 4.3.0 there is no function like FindBlockByLineNumber(int LineNo)
Please give me any other solution to findout.
Yes this function was introduced in Qt 4.5.
You can use But this will only works for character position, not with line number.
Re: Moveto perticular leine in QTextDocument
Quote:
Originally Posted by
yogeshgokul
Yes this function was introduced in Qt 4.5.
You can use
But this will only works for character position, not with line number.
I saw findBlock().But i cant use it. I want the position of a perticular. I have input is only Line Number.Do Uou hava any solution for this.
Re: Moveto perticular leine in QTextDocument
Quote:
Originally Posted by
bismitapadhy
I have input is only Line Number.Do Uou hava any solution for this.
Update your Qt to 4.5. ;);)
Re: Moveto perticular leine in QTextDocument
Quote:
Originally Posted by
yogeshgokul
Update your Qt to 4.5. ;);)
We have only Qt 4.3 license. So if you have any solution using Qt 4.3 please tell.