Results 1 to 2 of 2

Thread: Console input without blocking program

  1. #1
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Console input without blocking program

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Console input without blocking program

    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,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    havoc (21st August 2013)

Similar Threads

  1. HOW CAN I INPUT A QString IN THE CONSOLE
    By ayanda83 in forum Newbie
    Replies: 2
    Last Post: 26th August 2012, 23:24
  2. running external console program by gui program
    By alireza.mixedreality in forum Qt Programming
    Replies: 4
    Last Post: 24th April 2010, 18:05
  3. Replies: 8
    Last Post: 26th March 2010, 12:45
  4. Console input with QCoreApplication
    By rahman.duran in forum Qt Programming
    Replies: 4
    Last Post: 25th February 2009, 10:37
  5. Replies: 5
    Last Post: 24th July 2007, 17:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.