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

[Reg 5.1 -> 5.15 and all 6.*] QTextDocumentation does not handle background of HTML string correctly

XMLWordPrintable

    • 8be3c9f48 (dev), 55b2011bc (6.7), c64fb06af (6.6), cc46a4789 (tqtc/lts-6.5)

      A simple reproducer for testing:

      int main(int argc, char *argv[]) {
          QApplication a(argc, argv);
      
          QTextDocument* doc = new QTextDocument;
          QString strWithBgd("<i><font style=\"font-size:72px\"><font style=\"background:#FFFF00\">イ雨エ</font></font></i>");
          QString strWithoutBgd("<i><font style=\"font-size:72px\">イ雨エ</font></i>");
          doc->setHtml(strWithBgd + "<br>" + strWithoutBgd);
      
          QTextEdit* text = new QTextEdit;
          text->setDocument(doc);
          text->show();
      
          return a.exec();
      }
      

      2 HTML strings are being tested: one with background and one without. And the result is what attached screenshot shows, that somehow background is rendered on top of the character on left side so that the character on left side is "clipped". And the string without background is rendered as expected.

      It is reported that everything works fine back in 5.1. Customer provides a screenshot for comparison between 5.1 and 5.15 (I don't have 5.1 environment, so I haven't tested).

      It seems like that under extreme condition, i.e. large italic character gets rendered into rendering area of other character, the z-ordering is somehow broken.

        1. HTML_Font_Issue.png
          11 kB
          Luqiao Chen
        2. 5.1_vs_5.15.png
          49 kB
          Luqiao Chen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: