[SailfishDevel] TextArea | Using EnterKey.onClicked
ncis20 at gmail.com
Thu Feb 5 23:11:22 UTC 2015
I'm using the EnterKey.onClicked in a TextArea, the problem is that if I
retrieve the text area's text in the callback function, it has a trailing
newline (the enter input). Is there a way to prevent the enter key?. I
though of striping the enterkey by hand in the callback like `textArea.text
= textArea.text.slice(0, -1)`, but, the problem is that if you are not in
the end of the input this doesn't work.
The example is simple:
EnterKey.onClicked: console.log("my text is: \""+textArea.text+"\"")
I tried to see if the event works (as the QML Keys Element [
http://doc.qt.io/qt-5/qml-qtquick-keys.html ] ), but it doesn't.
I try using the qml Keys api:
But doesn't work, the only signal fired is EnterKey.onClicked.
In addition, my idea is to allow the user to input enters by using shift
and then the enter key, is there a way in order to achieve this?.
Any help is appreciated! =)
Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel