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

QStaticText doesn't support text-decoration css property.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.7.0, 4.7.1, 4.7.2, 4.7.3, 4.7.4, 4.8.0, 4.8.1
    • GUI: Text handling
    • None
    • Windows7, Windows Vista, Windows XP

    Description

      Properties like font-weight, color, font-style do have an effect but the text-decoration does not. See the attached example program where is HTML string using a <span> element to underline a part of the string. This doesn't seem to have any effect using <span style="text-decoration: underline">...</span>. Also when using just plain underline tags <u></u> it doesn't work.

      There is also a conflict in the documentation of QStaticText concerning this issue stating that "For extra convenience, it is possible to apply formatting to the text using the HTML subset supported by QTextDocument.". However in the next chapter of the documention is said that "QStaticText can only represent text, so only HTML tags which alter the layout or appearance of the text will be respected. Adding an image to the input HTML, for instance, will cause the image to be included as part of the layout, affecting the positions of the text glyphs, but it will not be displayed. The result will be an empty area the size of the image in the output. Similarly, using tables will cause the text to be laid out in table format, but the borders will not be drawn."

      It seems that the HTML subset supported by QTextDocument is not entirely applicable to QStaticText formatting.

      Attachments

        1. main.cpp
          0.8 kB
          Qt Support
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            qtcomsupport Qt Support
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes