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

Text: elide and maximumLineCount incompatible

XMLWordPrintable

      In what looks like a regression introduced sometime during the last 30 days or so, when you specify both 'elide' and 'maximumLineCount' in Text element, the text gets elided but only takes one line.

      import QtQuick 2.0
      
      Text {
          text: "Undeserved praise causes more pangs of conscience later than undeserved blame, but probably only for this reason, that our power of judgment are more completely exposed by being over praised than by being unjustly underestimated"
          width: 100
          elide: Text.ElideRight
          wrapMode: Text.Wrap
          maximumLineCount: 4                // (a)
          Component.onCompleted: {
              maximumLineCount = undefined   // (b)
              maximumLineCount = 5           // (c)
          }
      }
      

      I investigated a bit, and here are my results.

      Commenting lines (b) and (c), I'm seeing the bug.
      Commenting line (b), I'm seeing the bug, too.
      Commenting lines (a) and (b), I'm not seeing the bug.
      Leaving the code as it is, I'm not seeing the bug, either.

        For Gerrit Dashboard: QTBUG-24293
        # Subject Branch Project Status CR V

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            dedietri Gabriel de Dietrich (drgvond)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes