Results 1 to 5 of 5

Thread: Console input with QCoreApplication

  1. #1
    Join Date
    Feb 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Console input with QCoreApplication

    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?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Console input with QCoreApplication

    use standard std::cin.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Console input with QCoreApplication

    why do u want console input after that..could you please clarify ur problem

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Console input with QCoreApplication

    Use QSocketNotifier on stdin. When you're notified, you can do your reading.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Console input with QCoreApplication

    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

Similar Threads

  1. QtEmbedded TouchScreen Input Methods
    By QbelcorT in forum Newbie
    Replies: 0
    Last Post: 23rd November 2008, 07:43
  2. Replies: 0
    Last Post: 18th October 2008, 23:01
  3. 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.