View Full Version : float a = textedit???

10th October 2007, 15:04
i have programmed in Builder 5 c++ And I want to migrate to qt, someone can say to me how :

A = Form1->edit1->text.StrToInt(); or float or double.

at c'll be something like scanf("%d" &A);

also I would like being able to assign values to the vectors and "matrices" (excuse me I speak spanish) using xyz files (dat, txt, xls...etc).

Excuse me again as I said, I use to be program at Builder 5 c++

10th October 2007, 15:22
Take a look at QString::toInt() and QString::toDouble()

10th October 2007, 17:29
OK. I tried thit. why doesn´t work



10th October 2007, 18:25
Probably because the code I gave you is meant for Qt4 and you are using Qt3, despite of what the "Related to" info in this thread says. If you look at QString docs for Qt3, you'll find similar methods to convert the string to int or double.

By the way, the code from the screenshot doesn't make sense. Make sure to read the docs of QLineEdit to see how to set a text in it.