Here is a very simple application to illustrate the problem I am having.
#include <QTextStream>
int main()
{
QTextStream cin(stdin);
QTextStream cout(stdout);
QString test;
cout << "Enter a value: ";
cout.flush();
cin >> test;
cout << "Enter another value: ";
cout.flush();
test = cin.readLine();
cout << test;
return 0;
}
I expect execution to pause and wait for input at test = cin.readline();
, but it does not. If I remove cin >> test;
then it pauses.
Why is this code behaving like this and how do I get behaviour I want?