No textEdited() for TextArea QML Type
-
Why is theere no textEdited() for TextArea QML Type?
While TextInput ( https://doc.qt.io/qt-6/qml-qtquick-textinput.html#:~:text=editingFinished()-,textEdited(),-Methods ) Has it though...
How would I implement that myself in the QML
(https://doc.qt.io/qt-6/qml-qtquick-controls2-textarea.html)? -
Why is theere no textEdited() for TextArea QML Type?
While TextInput ( https://doc.qt.io/qt-6/qml-qtquick-textinput.html#:~:text=editingFinished()-,textEdited(),-Methods ) Has it though...
How would I implement that myself in the QML
(https://doc.qt.io/qt-6/qml-qtquick-controls2-textarea.html)? -
@JoeCFD This will not satisfy the requirements.of `textEdited().
onEditedFinished()is only when lost focus, or deliberately pressed enter.
It will not continuously processes your keyboard input.onTextEdited(), is like onChanged() but only when user perform the change (and not code)
-
@JoeCFD This will not satisfy the requirements.of `textEdited().
onEditedFinished()is only when lost focus, or deliberately pressed enter.
It will not continuously processes your keyboard input.onTextEdited(), is like onChanged() but only when user perform the change (and not code)
-
@pavanbellary Checked, but it does not exists
The error msg.
qrc:/untitled/main.qml:11:9: Cannot assign to non-existent property "onTextEdited"The code
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") TextArea { onTextEdited: { console.log("asdasd"); } } }It is also missing in the documentation of Qt6.4
-
@pavanbellary Checked, but it does not exists
The error msg.
qrc:/untitled/main.qml:11:9: Cannot assign to non-existent property "onTextEdited"The code
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") TextArea { onTextEdited: { console.log("asdasd"); } } }It is also missing in the documentation of Qt6.4
@shemeshg , sorry, use onTextChanged signal which is associated with property of text.
-
@shemeshg , sorry, use onTextChanged signal which is associated with property of text.
@pavanbellary onTextChanged will not provide onTextEdited() desired functionality
because it will also be triggered
- when the component is initialized,
- when changes triggered programmatically by other component or emitter.
Imagine Editor, and you want a notification only for none saved changes made by the user..
You might think of onKeyPressed as solution, but then you'll have to filter all the Control+Whatever, and none printable keyboard shortcut.
Modifying onKeyPressed will not be an easy task either, because you will have to maintain a flag for every "Silent key" (like Alt,Ctrl,Cmd, shift etc...)