← Back to team overview

ubuntu-phone team mailing list archive

Re: is it possible to qml textinput save data?

 

Data of the TextInput element is accessible through its text property (ie. textInputId.text). The data in a TextInput element is stored as a string and therefore can not be multiplied even if it is a number. You can use a JavasScript parseInt() function to convert a string to an integer.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

You can use the editingFinished() signal of the TextInput element to start your function which would operate on the data entered and then return the result. You can find more information on the TextInput element here http://qt-project.org/doc/qt-5/qml-qtquick-textinput.html


On 14-07-06 11:10 AM, Diogo Figueira wrote:
Hi

I would like to know if its possible to textinput (when a user inserts the data) save data like 1,2,3, and then multiply that data and show it in a textinput ??




References