Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-747

QTextEdit and HTML <hr> tag bug

    XMLWordPrintable

Details

    Description

      The following example demonstrates a bug in the HTML rendering.

      For some reason there is a line underneath the "A line which should not..." sentence as well.

      #include <QApplication> 
      #include <QTextEdit> 
      
      int main(int argc, char **argv) 
      { 
          QApplication a(argc, argv); 
          QTextEdit te; 
          te.append("A simple first sentence."); 
          te.append("<hr>"); 
          te.append("A line which should not be underlined but is?"); 
          te.show(); 
          return a.exec(); 
      } 
      

      Update:
      A temporary work-around:

          te.append("A simple first sentence.");
          QTextBlockFormat blockFmt = te.textCursor().blockFormat();
          te.append("<hr>"); 
          te.append("A line which should not be underlined but is?"); 
          te.textCursor().setBlockFormat(blockFmt);
      

      You can also add a "<br />" tag behind the <hr>

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            rve Anders Bakken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes