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

line-height does not work in QML Text RichText

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.4.1
    • None
    • Qt 5.4.1 on Linux and iOS
    • 2c2eb24975bbf5c698d4d23c6a5060729339d9f3

    Description

      Changing line-height through CSS has no effect on Text rendered using Text.RichText:

      import QtQuick 2.4
      
      Row {
          Text {
              width: 200
              textFormat: Text.RichText
              wrapMode: Text.WordWrap
              text: "<style>
                      p {
                          color: #777;
                          line-height: 200%;
                      }
                     </style><p>This is a test of text rendering with a varying line height which seems to be broken</p>"
          }
      
          Text {
              width: 200
              wrapMode: Text.WordWrap
              textFormat: Text.RichText
              text: "<style>
                      p {
                          color: #555;
                          line-height: 100%;
                      }
                     </style><p>This is a test of text rendering with a varying line height which seems to be broken</p>"
          }
      }
      

      Both labels look the same, apart from the color, which is there to show that the CSS condition indeed matches the text.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            broulik Kai Uwe Broulik
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes