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. RTF
Qt 6.11 is out! See what's new in the release blog

RTF

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 683 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
    Charlie2406
    wrote on last edited by Charlie2406
    #1

    How do I copy rtf text (ctrl + c) and paste it into a QTextEdit widget in run time while preserving the rich text format? Btw, this works in QDialog until I save it to a QStringList and retrieve it which converts it to plain text. Also, is it possible for a Qt programmer to incorporate the rtf editor available in QtCreator into his/her own apps?

    Pl45m4P C 2 Replies Last reply
    0
    • C Charlie2406

      How do I copy rtf text (ctrl + c) and paste it into a QTextEdit widget in run time while preserving the rich text format? Btw, this works in QDialog until I save it to a QStringList and retrieve it which converts it to plain text. Also, is it possible for a Qt programmer to incorporate the rtf editor available in QtCreator into his/her own apps?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Charlie2406 said in RTF:

      Btw, this works in QDialog until I save it to a QStringList and retrieve it which converts it to plain text

      Of course, you cant save rich text in a plain QString.

      Also, is it possible for a Qt programmer to incorporate the rtf editor available in QtCreator into his/her own apps?

      Look at the QtCreator source how it's done there and feel free to built your own :)

      This might also be helpful:

      • https://doc.qt.io/qt-6/richtext.html
      • https://doc.qt.io/qt-6/richtext-structure.html

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      C 1 Reply Last reply
      0
      • C Charlie2406

        How do I copy rtf text (ctrl + c) and paste it into a QTextEdit widget in run time while preserving the rich text format? Btw, this works in QDialog until I save it to a QStringList and retrieve it which converts it to plain text. Also, is it possible for a Qt programmer to incorporate the rtf editor available in QtCreator into his/her own apps?

        C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        @Charlie2406 Welcome to the Qt forums

        I assume you mean text with a format applied and not RTF. There is no RTF support in Qt that I am aware of.

        The QTextEdit will accept some rich text if the QTextEdit::acceptRichText() property is true (the default). In this case, the clipboard would need the clipboard MIME data to include either an HTML component, a rich text copy from another Qt program (application/x-qrichtext or application/x-qt-richtext), or possibly Markdown (text/markdown).

        You can QTextEdit::canInsertFromMimeData() and QTextEdit::insertFromMimeData() to cater for anything you need to paste.

        1 Reply Last reply
        0
        • Pl45m4P Pl45m4

          @Charlie2406 said in RTF:

          Btw, this works in QDialog until I save it to a QStringList and retrieve it which converts it to plain text

          Of course, you cant save rich text in a plain QString.

          Also, is it possible for a Qt programmer to incorporate the rtf editor available in QtCreator into his/her own apps?

          Look at the QtCreator source how it's done there and feel free to built your own :)

          This might also be helpful:

          • https://doc.qt.io/qt-6/richtext.html
          • https://doc.qt.io/qt-6/richtext-structure.html
          C Offline
          C Offline
          Charlie2406
          wrote on last edited by
          #4

          @Pl45m4 said in RTF:

          https://doc.qt.io/qt-6/richtext.html
          https://doc.qt.io/qt-6/richtext-structure.html

          Thanks for the help. I will check out the web sites and source code tomorrow.

          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