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

QTextEdit::toHtml() adds font generic-family inside the same single quotes with the font name

    XMLWordPrintable

Details

    • 6ff0614b61b8645ec7ca4ea40501a0b6719a92fd (qt/qtbase/5.13)

    Description

      When copy pasting text from e.g. Microsoft Word to QTextEdit widget and calling toHtml() the resulting html document is gererated so that the font generic-family is inside the same single quotes as the font name e.g. font-family:'Times New Roman,serif' instead of font-family:'Times New Roman',serif.
      Since that's not valid font name the resulting html is defaulting to what ever font has been set as the default in browser.

      Steps to reproduce the issue:
      1. Open the attached word document
      2. Copy & paste it to the attached test application text edit widget
      3. Write it to the html file by pressing the 'Save to' button in application

      Expected outcome:
      The resulting html file is valid.

      Actual outcome:
      Resulting html is including font generic-family inside the same quotes with the font name.

      Notes:
      toHtml() seems to also add additional 12px margin-top to all paragraphs

      Attachments

        1. qtbug66794_diag.diff
          4 kB
        2. QTBUG-66794.tar.gz
          12 kB
        3. qtbug66794.zip
          13 kB
        4. test.html
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            kileppal Kimmo Leppälä
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes