Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
Description
import QtQuick 2.0 Rectangle { width: 400 height: 400 property real defaultWidth: txt.implicitWidth Text { id: txt text: "hello world" width: 100 elide: Text.ElideRight } MouseArea { anchors.fill: parent onClicked: txt.width += 10 } }
- In the above example, we do an extra relayout on every click for calculating the implicit width (which does not change)
- In some cases, we call QFontMetrics::elidedText() with a width <= 0. We should avoid this call (or make elidedText short circuit much more quickly).
- Alternatively, we could consider taking care of the eliding ourselves (this might also require us handling length variants)