Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Custom documentLayout for QTextDocument



  • I want to experiment with QAbstractTextDocumentLayout to see how I can influence how the contents of a QTextDocument is painted in a QTextEdit. But I can't seem to find a good starting point. The QTextDocumentLayout contains a lot of private stuff and isn't exactly suitable as an entry point.

    I could not find anything usable on Google, so perhaps someone can help me to get started?


  • Lifetime Qt Champion

    Hi,

    AFAIK, QTextDocmentLayout is currently the best example. The fact that it uses some private APIs doesn't make it unsuitable as starting point. You can still learn how you can implement one thing or the other from it.



  • Yes. I already reworked the htmlparser to a custom one.
    Anyhow, I will focus on the QTextDocumentLayout.
    Thanks @SGaist!


Log in to reply