How to get Intput from TextInput upon pressing the done button on Android keyborad.[solved]
-
@vishnucool220 Use accepted or editingFinished signal. Add their respective signal handlers. It will be triggered when enter/return key is pressed.
-
@vishnucool220 It works on android too. You are seeing them because it is still in composing state. Once you click enter it should be gone.
To avoid this also you can setinputMethodHints: Qt.ImhDigitsOnly
orinputMethodHints: Qt.ImhNoPredictiveText
(this disables the dictionary support) -
@p3c0
yes. But code works perfect it is sending the data which is in the limit. If i put a value which is not validated it is not sending.No problem at the backend . Only problem is for the user. The user might think it is valid number.How can i restrict him not to give invalid input? Thanks -
@vishnu Hmm that is expected behavior. From the docs:
Input is accepected but invalid if it contains a double that is outside the range or is in the wrong format; e.g. with too many digits after the decimal point or is empty.
In this case use the
accepted
signal to check the validity of the input. It won't trigger if the number is not in that range.TextInput{ validator: DoubleValidator { bottom: -1500; top: 1500; decimals: 1000; notation: DoubleValidator.StandardNotation } onAccepted: console.log("Accepted") //won't trigger if not input not valid }
-
@p3c0
Perfect. Instead on poping up new thread .I want to ask here itself. when ever i press on the TextInput Box on Android . These were shown on the application output. What does it mean ? Is something wrong ?
W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 7920): showStatusIcon on inactive InputConnection
W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 7920): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 7920): endBatchEdit on inactive InputConnection