How can I display two QTextEdit widget share same content?
-
wrote on 25 Jul 2017, 07:06 last edited by
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 belowplainWindow->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. -
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 belowplainWindow->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.@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.
1/2