Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.10
-
56ade46b4234bb828b8e4f9a6bf83b5687bd122e
Description
The expected behaviour is that the last text item is rendered without any visible text, but showing the grey Rectangle child item.
import QtQuick 2.9 import QtQuick.Window 2.0 Window { id: window visible: true width: 640 height: 600 property string text: "AAAAAAAAAAAaaaaaaaaaa" Column { Text { // Unelided, no explicit size; works text: window.text leftPadding: 38 Rectangle { anchors.fill: parent color: "transparent" border.color: "darkorange" } } Text { // Right-elided, explicit size greater than leftPadding; works text: window.text width: 31 elide: Text.ElideRight leftPadding: 30 Rectangle { width: parent.leftPadding height: parent.height color: "grey" opacity: 0.5 } Rectangle { anchors.fill: parent color: "transparent" border.color: "darkorange" } } Text { // Right-elided, explicit size less than leftPadding; doesn't show up text: window.text width: 30 elide: Text.ElideRight leftPadding: 40 Rectangle { width: parent.leftPadding height: parent.height color: "grey" opacity: 0.5 } Rectangle { anchors.fill: parent color: "transparent" border.color: "darkorange" } } } }
If you add a "change handler" to see the value of the implicitWidth, it's rendered, but with all of the text visible (see qt60328-rendered.png):
onImplicitWidthChanged: print(implicitWidth)
This was found in the auto tests of https://codereview.qt-project.org/#/c/190505/.
Attachments
Issue Links
- relates to
-
QTBUG-67145 When reparenting a control that uses IconLabel (like Button) and has a binding to its parents height, its text will stop being rendered when the control is reparented back
-
- Closed
-
For Gerrit Dashboard: QTBUG-60328 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
225529,6 | Fix Text with ElideRight not being rendered when reparented | 5.11 | qt/qtdeclarative | Status: MERGED | -2 | 0 |