Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.1.1
-
None
-
I0c4aafbcc50343bb0ec8b5f335045e1048a499fd
Description
When a value other than ElideNone is specified for a Text component, it is implied that the string will be elided and effectively clipped to the explicit width of the Text object. This works correctly until you enter a width of 0 at which time Text falls back to the implicitWidth automatically. This results in a component with a width of 0, and an implicitWidth > 0, and the text is rendered with no ellipses at full length.
Text { width: 0 elide: Text.ElideRight text: "Some text that should be elided and clipped" Component.onCompleted: console.log( "Width: " + width + " implicitWidth: " + implicitWidth ) }
If you give the Text a non-zero value for width, even 0.5 the string is correctly clipped.
Attachments
For Gerrit Dashboard: QTBUG-34990 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
109478,8 | Fix to text length in Text when width:0 and elide right | 5.5 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
149656,3 | Fix to text length in Text when width:0 and elide right | dev | qt/qtdeclarative | Status: ABANDONED | -1 | 0 |
149759,1 | Fix to text length in Text when width:0 and elide right | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
149763,3 | Don't render when width is zero and elide is not None | 5.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |