No, here is some code that shows the problem:
import QtQuick 2.0
import QtQuick.Controls 1.3
Item {
Rectangle {
id: textin
anchors.top: parent.top
anchors.topMargin: parent.height / 10
width: parent.width * 0.8
height: parent.height / 3
anchors.horizontalCenter: parent.horizontalCenter
border.color: "#000000"
TextEdit {
id: ptext
anchors.fill: parent
clip: true
textMargin : 10
wrapMode : Text.WordWrap
text: "test"
onTextChanged: {
textcount.text = ptext.text.length
console.log(text, ptext.text.length)
}
}
Text {
id: textcount
anchors.bottom: textin.bottom
anchors.right: textin.right
width: parent.width * 0.2
height: parent.height * 0.2
}
}
}
import QtQuick 2.0
import QtQuick.Controls 1.3
Item {
Rectangle {
id: textin
anchors.top: parent.top
anchors.topMargin: parent.height / 10
width: parent.width * 0.8
height: parent.height / 3
anchors.horizontalCenter: parent.horizontalCenter
border.color: "#000000"
TextEdit {
id: ptext
anchors.fill: parent
clip: true
textMargin : 10
wrapMode : Text.WordWrap
text: "test"
onTextChanged: {
textcount.text = ptext.text.length
console.log(text, ptext.text.length)
}
}
Text {
id: textcount
anchors.bottom: textin.bottom
anchors.right: textin.right
width: parent.width * 0.2
height: parent.height * 0.2
}
}
}
To copy to clipboard, switch view to plain text mode
qrc:/debug.qml:19 (onTextChanged): qml: test 4
qrc:/debug.qml:19 (onTextChanged): qml: testa 5
qrc:/debug.qml:19 (onTextChanged): qml: testab 6
qrc:/debug.qml:19 (onTextChanged): qml: testabc 7
qrc:/debug.qml:19 (onTextChanged): qml: testabc 8
qrc:/debug.qml:19 (onTextChanged): qml: testabc 8
qrc:/debug.qml:19 (onTextChanged): qml: testabc 8
qrc:/debug.qml:19 (onTextChanged): qml: testabc 8
qrc:/debug.qml:19 (onTextChanged): qml: testabc 8
qrc:/debug.qml:19 (onTextChanged): qml: testabc test 12
qrc:/debug.qml:19 (onTextChanged): qml: testabc test 13
Bookmarks