Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt iterate over rich text document
Delphi251189 last edited by Delphi251189
Hi, I need to iterate over QTextDocument and for each block I need to know absolute position of top left corner of a block relative to document (in pixels): Is there any way?
something like this for each TextBlocks
The offical documentation says something about QTextBlock or QTextFragment positions like this
but as far as I understand this is not what I'm looking for, because these functions return int instead of QPoint or QPointF
Bonnie last edited by
What about https://doc.qt.io/qt-5/qabstracttextdocumentlayout.html#blockBoundingRect ?
Get the layout from https://doc.qt.io/qt-5/qtextdocument.html#documentLayout
Thank You @Bonnie!!! This is exactly what I am looking for