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

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.7.0
    • Fix Version/s: 5.10.0 Alpha
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      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

          For Gerrit Dashboard: QTBUG-56848
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                poikelin Joni Poikelin
                Reporter:
                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