Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-335

Duplicate text metrics computation when elide or word wrap is used

    XMLWordPrintable

Details

    Description

      When elide / word wrap is used and a width is explicitly set, the text metrics computation (TextEngine::metrics) gets triggered multiple times during the same frame.

      In this example, it gets triggered four times instead of the expected two times:

       

      import QtQuick 2.15
      Rectangle {
          color: "#41CD52"
      
          Text {
              id: text
              text: "Text"
              horizontalAlignment: Text.AlignHCenter
              width: 100
              height: 100
              elide: Text.ElideRight
              wrapMode: Text.WordWrap
          }
          Timer {
              interval: 400
              running: true
              onTriggered: {
                  text.text = "Other text"
                  text.width = 80
                  text.height = 80
              }
          }
      }
      

      Attachments

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

        Activity

          People

            srodal Samuel Rødal
            srodal Samuel Rødal
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes