Results 1 to 2 of 2

Thread: Doubt about QTextEdit and Rich Text

  1. #1
    Join Date
    Oct 2008
    Location
    Thodupuzha, a small town in kerala
    Posts
    31
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Doubt about QTextEdit and Rich Text

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Doubt about QTextEdit and Rich Text

    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().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  2. Drawing Rich Formatted Text with QPainter
    By millsks in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2009, 19:59
  3. Rich text in QGraphicsTextItem
    By maverick_pol in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2008, 20:08
  4. QTextEdit + paste rich text as plain text only
    By Yong in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 16:45
  5. Rich Text Tale Vol1 : Background colors
    By fullmetalcoder in forum Qt Programming
    Replies: 37
    Last Post: 9th February 2006, 15:05

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.