PDA

View Full Version : conversion of lineedit text to numeric form



sachinmcajnu
9th March 2011, 17:37
i want to build simple calculator that add two numbers
i am using lineedit for taking input how can i use that value and convert it to some numeric form
for calculation
plz help

ghal maraz
9th March 2011, 17:43
ui->lineEdit->text().toInt()

additional you can define an input mask for the lineedit.

sachinmcajnu
9th March 2011, 18:34
ui->lineEdit->text().toInt()

additional you can define an input mask for the lineedit.

also plz tell me if have add two nos ........how can i set the label to that no

squidge
9th March 2011, 18:45
The QString documentation tells you everything you need. How to convert from text to number and how to convert from number to text.