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. Copy and Paste into a QPlainTextEdit when data includes an image
Forum Updated to NodeBB v4.3 + New Features

Copy and Paste into a QPlainTextEdit when data includes an image

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 403 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.
  • C Offline
    C Offline
    Chrisw01
    wrote on last edited by
    #1

    Hi,

    I have a ui that has a QPlainTextEdit box in it. When I copy and paste anything into this box with an image the image is not inserted with the text. I've done some research and don't think it is designed in such a manor. I've also read that QTextEdit is the same way. I've found bits and pieces on the internet but they don't seem to fit my needs. How would you recommend going about a simple text box that will accept a image in it.

    Thanks in advance..

    Chris

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QPlainTextEdit will not do that, it's not its goal.

      For QTextEdit, this thread might help.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Chrisw01
        wrote on last edited by
        #3

        Thanks SGaist that allowed the copy and paste of the image into the QTextEdit but now presents another problem. The contents of that QTextEdit is written to disk (the box is actually a Email Signature Box.) via QSettings however the data is not transferred to disk and I end up with a funky little image that just says "obj" when I send the email. Other than that it works fine.. suggestions ?

        Thanks

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chrisw01
          wrote on last edited by
          #4

          I figured it out. Instead of using toPlainText to get the data I use to Html and store that. Works like a champ. Thanks again SGaist.

          1 Reply Last reply
          1

          • Login

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