How to Subclass QAbstractTextDocumentLayout

  • Backgrounds

    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::ObjectReplacementCharacter to insert preview images, which will mess up the modification state and UNDO/REDO stack.


    I want to custom the layout of QTextDocument by subclassing 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!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.