PDA

View Full Version : Console input with QCoreApplication



rahman.duran
25th February 2009, 10:15
Hi.

I am trying to figure out how to take user input from console application. I cant handle console input after qcoreapplication.exec() runs. Any advice?

spirit
25th February 2009, 10:24
use standard std::cin.

talk2amulya
25th February 2009, 10:24
why do u want console input after that..could you please clarify ur problem

wysota
25th February 2009, 10:27
Use QSocketNotifier on stdin. When you're notified, you can do your reading.

rahman.duran
25th February 2009, 10:37
I wrote a very simple console app that playback audio with phonon. The problem is I want user to control playback ( play, pause, stop etc. ) with simple commands from console. But the code I wrote after exec(), never reached as qcoreapplication enters event loop. BTW, I cant control phonon before exec() because it doesnt do anything before exec();

So what I need is to take user input from console after qcoreapplication enters its event loop.

And I am just writing this app to learn qt. As a Java dev I am trying to figure out qt mechanisms :)