Cannot assign to non-existent property "onTextEdited" TextField QML?
-
Hello,
with QT 5.14 on windows 64, following documentation saying:
**textEdited()
This signal is emitted whenever the text is edited. Unlike textChanged(), this signal is not emitted when the text is changed programmatically, for example, by changing the value of the text property or by calling clear().
The corresponding handler is onTextEdited.
This signal was introduced in Qt 5.9.
**I received message Cannot assign to non-existent property "onTextEdited" using code:
import QtQuick 2.14 TextField { id: searchInput width:500 placeholderText:"Part Number, serial number, description" font.pixelSize: 20 anchors.top:parent.top anchors.left:parent.left anchors.margins:10 activeFocusOnPress: true activeFocusOnTab: true focus: true selectByMouse: true onTextEdited: console.log(searchInput.text) }
I don't understand why, could you help me please?
Thanks a lot
Philippetexte en italique
-
-
@jsulm Hi,
I solve this with:
FocusScope { id: searchInput width: 500; height: 28 signal textEditedSignal(string msg) TextInput { id: textInput anchors.fill:parent font.pixelSize: globalScaleFactor* 20 selectByMouse: true onTextEdited: { searchInput.textEditedSignal(textInput.text); console.log( textInput.text)} } }
-
-
@Pradeep-P-N said in Cannot assign to non-existent property "onTextEdited" TextField QML?:
TextField { } and TextInput { } are completely different components
TextField is actually a TextInput