PDA

View Full Version : Doubt about QTextEdit and Rich Text



iamjayanth
8th April 2009, 06:23
Hi all,

I am trying to learn QTextEdit and rich text property using QT 3.3. I have the following doubts.

1. If we are using append() function in QTextEdit I am able to use rich text format. But since append() adds a default new line character, which is not according to my requirement. I used insert() . But when I use insert rich text is not working and tags are getting printed as it is. Is there any way to add rich text property to insert or use append() without default new line character. I am using QT 3.3.

2. In rich text , when I tried to use size tag in <font> .... </font> property, I failed to get the actual logical size. In the definition of size tag they are saying a logical size value between 0 to 7 is required. How can I get this size value from a QFont object.

I am new to these markup languages and rich texts. Can anybody help me out.

Jayanth.S

wysota
8th April 2009, 08:11
QTextEdit in Qt3 is completely messed up. If you can upgrade to Qt4, do it - it is much better there. And also remember this is rich text, not html - the font size can only be defined within bounds 1-7 as it used to be in HTML 3. If you want to change what these numbers mean, you have to adjust the stylesheet using QTextEdit::setStyleSheet().