Could you elaborate on what you mean by "unable to receive the string"? Which code runs, which does not?
Could you elaborate on what you mean by "unable to receive the string"? Which code runs, which does not?
Seems good now, I tested it with qdebug, and it was able to print out the emitted string. Sorry for the confusion.
I was wondering is it possible to use qdebug or something equivalent and use the message.toStdString with getline to use the emitted string as an input(cin)?
Correct me if I'm wrong about this, am I correct to say that qdebug can only be used for cout and not cin? On the other hand, if I'm using string string_in = message.toStdString(); as suggested, the app doesn't seem to be able to take the emitted string and do what it needs to do. The app just sits there waiting for an input, which it never gets when the pushbutton is clicked.
Also, I've tried using
doesn't seem to work.QTextStream qtin(stdin);
qtin >> message;
Last edited by ashboi; 11th September 2013 at 14:13.
For debug is for debugging output. If you don't want to use cin, you can use QTextStream with stdin. I assure you it works, apparently you're using it wrong.
Bookmarks