Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.1
-
None
Description
When QML Text 'text' property is reset to empty, lineCount remains same as was for prior text:
import QtQuick 2.12 import QtQuick.Window 2.12 Window { visible: true width: 640 height: 480 Text { id: test width: parent.width text: "qqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqq" wrapMode: Text.WordWrap onLineCountChanged: { console.log("test: " + test.lineCount) } } Timer { interval: 5000 running: true onTriggered: { test.text = "" console.log("test: " + test.lineCount) } } }
Expected output:
test: 2
test: 1
Actual output
test: 2
test: 2
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-84458 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
322088,6 | QML Text doesn't reset lineCount when text is empty | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
322514,2 | QML Text doesn't reset lineCount when text is empty | 5.15 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
322925,2 | QML Text doesn't reset lineCount when text is empty | 6.0 | qt/qtdeclarative | Status: MERGED | +2 | 0 |