Results 1 to 6 of 6

Thread: QTextStream does not read from stdin

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default QTextStream does not read from stdin

    Hello guys

    What's wrong with the code below that messagebox displays empty string??

    Qt Code:
    1. QTextStream stream(stdout);
    2.  
    3. std::cout<<"bla";
    4. qDebug()<<"ble";
    5.  
    6. QString line("initial");
    7.  
    8. line = stream.readLine();
    9.  
    10. QMessageBox::about(0,0,line);
    To copy to clipboard, switch view to plain text mode 
    Last edited by MasterBLB; 19th November 2012 at 10:13.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTextStream does not read from stdin

    what is 'stdout' ? Please read my sig.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QTextStream does not read from stdin


Similar Threads

  1. Replies: 1
    Last Post: 3rd January 2012, 10:25
  2. QTextStream cannot read £ characters?
    By KjellKod in forum Qt Programming
    Replies: 10
    Last Post: 15th August 2011, 14:58
  3. Replies: 2
    Last Post: 9th June 2010, 16:08
  4. Replies: 5
    Last Post: 27th May 2009, 12:49
  5. Read/Write from QTextStream
    By tonde in forum Qt Programming
    Replies: 7
    Last Post: 31st July 2008, 16:51

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.