How to Subclass QAbstractTextDocumentLayout
I am developing a desktop note-taking app VNote for Markdown using Qt5.7. I want to preview the image links in Markdown by displaying images in
QTextEdit. Currently I just insert
QChar::ObjectReplacementCharacterto insert preview images, which will mess up the modification state and UNDO/REDO stack.
I want to custom the layout of
QAbstractTextDocumentLayout. It will display an image below the link without modifying the document.
Does anyone has experience about using custom document layout? Will that be an option?
Thanks very much!