PDA

View Full Version : QAbstractTextDocumentLayout reimplementation



'milimoj
6th June 2015, 14:54
Can anyone help me with QAbstractTextDocumentLayout reimplementation. I can not find usable examples for reimplementation of draw, drawInlineObject and positionInlineObject functions?
For now I have managed to register my own handler and to insert my own items handled with it, but now I nead to draw some text and shapes inline with existing text in blocks, depending on block formating (Not to insert my items but to add text and shapes if text in block have desired formating).
Some help PLEASE.

'milimoj
6th June 2015, 22:19
Can anyone help me with QAbstractTextDocumentLayout reimplementation. I can not find usable examples for reimplementation of draw, drawInlineObject and positionInlineObject functions?
For now I have managed to register my own handler and to insert my own items handled with it, but now I nead to draw some text and shapes inline with existing text in blocks, depending on block formating (Not to insert my items but to add text and shapes if text in block have desired formating).
Some help PLEASE.

I must correct my self. I wish to draw some letters outside the text blocks, not inline, (for examle on the left margin of text block) and positioned on the vertical middle of the text block. As my pages are not static that letter must "follow" block when it is moved and must refresh when text/letter style of block is changed. For this I suppose that I must reimplement draw() function but I am not sure what is the right way to do it.

'milimoj
29th June 2015, 13:58
Any help??? Any useful ideas or examples links??? I'm still in dark here.