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. QTextEdit, (QPLAINTEXTEDIT) Need Help with making a copy to another QTextEdit along with its Color & other Format such as Bold for each letter...
Qt 6.11 is out! See what's new in the release blog

QTextEdit, (QPLAINTEXTEDIT) Need Help with making a copy to another QTextEdit along with its Color & other Format such as Bold for each letter...

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 457 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    Lineaxe
    wrote on last edited by Lineaxe
    #1

    QTextEdit, (QPLAINTEXTEDIT) Need Help with making a copy to another QTextEdit along with its Color & other Format such as Bold for each letter...

    Hi, I trying out several ways of making a copy. However, I am using QTextCursor to make the selection. Now That the text is selected in a QTextEdit Document I want to copy each line, one at a time into a different QTextEdit document.
    Whatever way I have tried. will not copy the Color Info, & Bold info of each Letter in the Document.

    I have tried :
    Copying text as selected by QTextcursor --- just copies over Black Colored text into QTextEdit

    Copying the input and output over with insertasHtml & insertHtml methods, the result was a jumbled up document in 2nd QTextEdit
    CUT & PASTE submethods --- not working

    I would love to know the proper method of copying over the QTextCursor's selected text, along with Color info into a 2nd QTextEdit. This is so that both QTextEdits look the same!

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      try to get styleSheet() from one text edit and set it to another one.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Lineaxe
        wrote on last edited by
        #3

        Hmm, that is an interesting solution. I will dig into how to set StyleSheet from one to the other. I had been using properties boxes and dynamic setting of the Fonts only. I will look into copying one style sheet over to the other to see if this will do the trick.

        1 Reply Last reply
        0

        • Login

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