Solved How to capture Qml TextArea typing event?
-
Hi,
Anyone know how to capture textarea typing (start editing and editing) ? It has only editingFinished event .
Thanks! -
@lemta2000
onTextChanged
handler is invoked when typing starts. -
@p3c0
Can i be a QML noob and ask why such signals is not listed?http://doc.qt.io/qt-5/qml-qtquick-controls-textarea.html
Where would i have seen that it has onTextChanged also ?
-
@mrjj In QML each property defined in a QML type has a signal and which have corresponding signal handler defined as
on<Property>Changed
.
More info here:
http://doc.qt.io/qt-5/qtqml-syntax-signals.html#property-change-signal-handlers -
@p3c0
Ahh, that is smart !
So any property is automatically a signal.
so you could also hook up to OnwidthChanged and so on.
thank you :) -
@mrjj In the backend they are just
Q_PROPERTY
's where they have a setter, getter and a signal.
For eg.
https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquickitem.h.html#109 -
@p3c0
Aha, its not so magical, just a normal QObject :)
Thx. I should try QML at some time. seems to mix nicely with c++. -
@mrjj You should definitely :)
-
@p3c0: thanks for your answer :)