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

How can I display two QTextEdit widget share same content?



  • Hello, I wonder how can I display two QTextEdit widget which share same content.
    I want to display html version of the content in one widget and display plain text version of the content in another widget.
    Currently, I did something like below

    plainWindow->ui->textEdit->setHtml(sourceWindow->ui->textEdit->toPlainText());
    

    But it is very slow.
    First few letters are fine. But response is very slow when content contains 50KB of text.
    I wonder if there exist some elegant way to share content.
    Thanks.


  • Moderators

    @QString said in How can I display two QTextEdit widget share same content?:

    I wonder if there exist some elegant way to share content.

    no, currently not.
    Since there is a rich-text and a plain-text layout object internally there is no data which can be shared.
    I would rather say do not display 50KB of data at once. Implement some type of paging instead.


Log in to reply