tags:

views:

219

answers:

3

What is exactly richtext and how do I format data in richtext in QTextEdit?

+1  A: 

QTextEdit can display text that is formatted with additional layout and style information (i.e. enriched) which can be set either programatically or by using a subset of HTML.

The Rich Text Processing documentation gives you an overview and pointers to more in-depth information.

Georg Fritzsche
yes, I know. The question is "What is richtext?", ie is it HTML or RTF etc.?
Regof
@Regof: It is an *enriched* text format which *can be set* in more then one way - using HTML or a programmatic interface - how its actually represented internally is irrelevant. Oh, and your question asked *how do i format data in richtext* (or *"using richtext"* in the title) :)
Georg Fritzsche
A: 

If you're looking for a WYSIWYG toolbar for the QTextEdit, you'll end up disappointed. There is no default one (although the SDK contains an example app). So you should either make the toolbar yourself or find one.

Henri
+1  A: 

The internal rich text format is tag/attribute-based, and is similar to HTML using in-line CSS style="xxx" attributes. The default export/import format (using toHTML/setHTML) is a subset of HTML. See this link:

http://doc.trolltech.com/4.6/richtext-html-subset.html

Note that CSS classes are not supported internally and are converted to their representing attributes at import.

wump