PDA

View Full Version : Console input without blocking program



havoc
16th August 2013, 22:15
hello,
I'm making a program based on TCP Sockets where I am receiving data and displaying it continuously. I want to know how to make an input without blocking the output and other processes running. Is there a way to do it? Can I make a separate console (like a child console) to input the required data without blocking main console or any other effective way to do it? Also where can I find a way to make a child console if I want to make such thing? Thanks in advance.

anda_skoa
17th August 2013, 14:28
You'll have to test this but maybe a QSocketNotifier on the stdin file descriptor would work and give you signals when input is available.
Otherwise you'll probably have to use a thread to read blockingly from stdin.

As for child processes, see QProcess.

Cheers,
_