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. Displaying RTF Text
Forum Update on Monday, May 27th 2025

Displaying RTF Text

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 4.1k 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.
  • B Offline
    B Offline
    Brandon
    wrote on last edited by
    #1

    I am being sent a string of text in the Microsoft rtf format. I have to display it. Can someone show me a simple example of how to display a string of rtf text?

    I should add that I do not need to edit it, search it, or do any other type of processing - only display it in a box of any kind. Please don't give me links to the top level of a library that does a thousand things. I only need to display a string of text.

    If I cannot display the rtf, it would probably be enough to be able to extract the plain text from it.

    Thanks in advance.

    Brandon

    1 Reply Last reply
    0
    • S Offline
      S Offline
      steno
      wrote on last edited by
      #2

      QLabel supports rich text. Just call QLabel::setText.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Brandon
        wrote on last edited by
        #3

        I tried it and it didn't work. It showed every tag. Then I tried it formatted with some simple HTML instead and that worked. However, I do not have HTML. This is Microsoft rtf format.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steno
          wrote on last edited by
          #4

          I don't think microsoft's rtf format is supported then straight out of the box.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Brandon
            wrote on last edited by
            #5

            I just wondered if anyone had figured anything out. I'm not really a QT expert and I hoped that maybe someone had a solution.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              steno
              wrote on last edited by
              #6

              I found this, you might be able to use it. Not sure what the licensing is on it though.

              "Rtf parser written with Qt":https://launchpad.net/rtf-qt

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Brandon
                wrote on last edited by
                #7

                It's very kind of you to find this for me. Is it a library or an executable?

                Nothing without 3rd party resources, though?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  steno
                  wrote on last edited by
                  #8

                  It's a library to parse Microsoft's rtf format. It is under the GNU LGPL v2.1 license. Someone else may be able to point you in a better direction. I think I ignored the Microsoft part when reading the post.

                  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