Results 1 to 2 of 2

Thread: Support for .rtf format in QTextDocument or QTextEdit?

  1. #1
    Join Date
    Nov 2009
    Posts
    44
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Support for .rtf format in QTextDocument or QTextEdit?

    I have a case where newly entered text in a database column is in HTML format - and QTextDocument and QTextEdit work great. However, older (legacy) entries are in .rtf format (the first characters of the string are "{\rtf1"). Does anyone know how to support rtf in Qt widgets? I always get the equivalent of plain text. Thanks in advance for any assistance!

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Support for .rtf format in QTextDocument or QTextEdit?

    There is no support for Microsofts Rich Text Format in Qt. All "rich text" stuff is realized with html and css.

    Look for an RTF to HTML Converter library. If there is none you will need to write one yourself. Starting point could be: http://latex2rtf.sourceforge.net/rtfspec_45.html

    Edit: Just found this - http://www.codeproject.com/KB/recipes/RtfConverter.aspx

    Edit2: If you need less features: http://www.codeguru.com/cpp/controls...-Converter.htm

    HIH

    Joh
    Last edited by JohannesMunk; 13th September 2010 at 23:08. Reason: updated contents

  3. The following user says thank you to JohannesMunk for this useful post:

    LynneV (16th September 2010)

Similar Threads

  1. Html used in QTextEdit and QTextDocument
    By nifei in forum Qt Programming
    Replies: 5
    Last Post: 15th August 2012, 20:38
  2. Replies: 1
    Last Post: 25th May 2011, 19:25
  3. QImageIOPlugin, support for new image format.
    By suneel1310 in forum Qt Programming
    Replies: 12
    Last Post: 6th March 2009, 10:21
  4. Handling mac text format files - support?
    By bnilsson in forum Qt Programming
    Replies: 0
    Last Post: 29th March 2008, 12:10
  5. QTextEdit,QTextDocument,QTextCursor
    By kemp in forum Qt Programming
    Replies: 3
    Last Post: 13th October 2006, 12:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.