Results 1 to 3 of 3

Thread: QTextEdit not adhering to CSS

  1. #1
    Join Date
    May 2006
    Location
    Waterloo, ON
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QTextEdit not adhering to CSS

    I would like to use CSS style sheets to format the HTML contents of a QTextEdit widget. It seems, however, that the widget supports a very restricted set of properties. Specifically, I cannot make it display borders or apply padding. I am able to set the background color and text margins.
    The same HTML code displays correctly in a browser.
    Is this a known limitation, a bug, or am I doing something wrong?

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextEdit not adhering to CSS

    It's a known limitation. QTextEdit only supports a limited subset of HTML and CSS. It was meant to be a rich text editor, and not a full HTML/CSS rendering engine. Please see http://doc.trolltech.com/4.4/richtext-html-subset.html

    However, it does support padding and borders. Maybe if you post your HTML string we can see what is wrong.

  3. #3
    Join Date
    May 2006
    Location
    Waterloo, ON
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTextEdit not adhering to CSS

    Thanks.
    According to the linked document, borders and paddings are only supported for tables. I was trying to get a <pre> block formatted.

Similar Threads

  1. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  2. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25
  3. Re-implement mouse events of QTextEdit
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2006, 16:55
  4. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  5. Painting to QTextEdit
    By gesslar in forum Qt Programming
    Replies: 8
    Last Post: 18th February 2006, 18:40

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.