Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I display two QTextEdit widget share same content?
Forum Update on Monday, May 27th 2025

How can I display two QTextEdit widget share same content?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 520 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on 25 Jul 2017, 07:06 last edited by
    #1

    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.

    R 1 Reply Last reply 25 Jul 2017, 07:09
    0
    • ? A Former User
      25 Jul 2017, 07:06

      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.

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 25 Jul 2017, 07:09 last edited by
      #2

      @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.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1

      1/2

      25 Jul 2017, 07:06

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved