Results 1 to 6 of 6

Thread: QTextEdit produces incorrect html

  1. #1
    Join Date
    Jan 2006
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTextEdit produces incorrect html

    Hi,
    is it to be considered a bug for the Trollteck issue tracker, if the QTextEdit widget in Qt4.1 produces not end tags </li> when making unnumbered lists, or is it a feature? As far as I can see most other closing tags are provided. I find it annoying because it prevents you from easily parsing the html it produces with a xml parser if there are some closing tags missing.
    Ah, I forgot to mention taht this phenomenon can be easily verified by using the editor coming with the demos ([QT_DIR/demos/textedit).
    Last edited by ccf_h; 7th February 2006 at 21:49. Reason: add a sentence

  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: QTextEdit produces incorrect html

    QTextEdit produces HTML output, not XHTML. And with HTML ommiting ending tags for <li> is valid.

  3. #3
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit produces incorrect html

    Quote Originally Posted by ccf_h
    I find it annoying because it prevents you from easily parsing the html it produces with a xml parser if there are some closing tags missing.
    You are right about this one

  4. #4
    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: QTextEdit produces incorrect html

    You can use external tools like HTML tidy to cleanup the code or make your own tidier. Or subclass QTextEdit and change it

  5. #5
    Join Date
    Jan 2006
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit produces incorrect html

    Quote Originally Posted by wysota
    Or subclass QTextEdit and change it
    Isn't it rather QTextDocument that should be subclassed in that case?

  6. #6
    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: QTextEdit produces incorrect html

    It's your call. Both will work, I guess.

Similar Threads

  1. Html used in QTextEdit and QTextDocument
    By nifei in forum Qt Programming
    Replies: 5
    Last Post: 15th August 2012, 20:38
  2. Replies: 2
    Last Post: 24th January 2009, 18:30
  3. QTextEdit and Html
    By giusepped in forum Qt Programming
    Replies: 1
    Last Post: 28th October 2008, 17:20
  4. Load HTML to QTextEdit
    By Gamalof in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2008, 18:08
  5. [Qt 4.1]using html in QTextEdit from designer
    By patcito in forum Qt Programming
    Replies: 5
    Last Post: 16th January 2006, 22:36

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.