View Full Version : read input string --> text mode

25th October 2007, 18:58
Hi, I want to read input from the user in text mode QT application and this doesn't stop the program to enter the name:

QString enteredName;
QFile inputFile,outputFile;
cout << "Enter the name you want to search for: ";

I didn't add the line where I want to write the contents into enteredName...how can I do that?

25th October 2007, 19:08
The following example is from QTextStream docs:

QTextStream stream(stdin);
QString line;
do {
line = stream.readLine();
} while (!line.isNull());