Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using richtext in QTextEdit

Tags:

c++

qt

qt4

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

like image 517
Regof Avatar asked May 01 '10 09:05

Regof


People also ask

Should I use plain text or rich text?

If you need advanced functionality with flexible styling options or you want to use a fancy email signature, use the HTML format. If you're only looking for adjustable text options, such as italics or bolding, use the Rich Text format. When you just want text and no other options, you can use the Plain Text format.

Does rich text allow formatting?

If you enable rich-text formatting for a rich text box, users can use a variety of options to format the text that they enter in that control. For example, they can apply a different font or character style to the text inside the rich text box or even insert a table into the rich text box.


1 Answers

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.

like image 93
wump Avatar answered Oct 25 '22 09:10

wump