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

Customizing a QPLainText widget or creating a new one



  • Hello!
    I'm building a text editor and the requirements for speed & scaling are rather strict. I need the editor to work swiftly even on very large files. The existing widgets are not fast enough, and, as the file grows larger, the program freezes.
    I would like to use a piece table data structure instead of QString.
    Is it possible to customize the QPlainTextEdit widget to work with my own custom class and not the QString? Or would you advice to write a new widget? This seems like a whole lot of work, as QTextCursor and QTextDocument also work with QStrings and will need to be modified.
    I would appreciate any suggestion on how to approach this issue!


  • Lifetime Qt Champion

    @kaliy23 I suggest you take a look at https://qscintilla.com/#



  • @jsulm, I apologize, I should've mentioned it in the original post: one of the requirements of the project is that we can not use any 3rd party library for the text editor, except for Qt.
    From what I see in the QScintilla github, it is ported to Qt on top of the TextEdit widget, so I will look further into their implementation to figure out how they've done it.