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

QTextEdit draws all lines on top of each other when line height specified in html

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.10.0 Alpha
    • 5.7.0
    • GUI: Font handling
    • None
    • Tested on OSX 10.11.3 2.9 GHz Intel Core i5

    Description

      If specifying line-height in the style tag when setting html on a QTextEdit, the property is not correctly respected and the lines all overlap each other (see attached)

      This is a common use case e.g. when pasting text from a web browser (e.g. a google doc for instance)

      To reproduce:

      #include <QApplication>
      #include <QtWidgets>
       
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QTextEdit x;
          x.show();
          QByteArray b("<meta charset=\"utf-8\"><p style=\"line-height:1.38;\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in volupfftate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>");
          x.setHtml(b);
          app.exec();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              poikelin Joni Poikelin
              jeremy Jeremy Cytryn
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes