Results 1 to 3 of 3

Thread: cout display

  1. #1
    Join Date
    Aug 2012
    Location
    Cape Town, South Africa
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default cout display

    Hi

    I have written an app that accepts user inputs from a widget. The problem is that i want to display the results(obtained from an input widget) to the console window. My console window stays blank though. To check that i do get input, i have written the results to a notepad document.

    Can anyone please tell me how to write my results to the console window?

    I tried this:

    QTextStream cout(stdout)

    cout << input->value();

    but my console window still stays blank

    Please help

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: cout display

    Try to flush stream, cout.flush();
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  3. #3
    Join Date
    Aug 2009
    Location
    Greece
    Posts
    69
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: cout display

    For windows you should have the
    Qt Code:
    1. CONFIG += console
    To copy to clipboard, switch view to plain text mode 
    added in your .pro file

Similar Threads

  1. Qt Creator where is cout in Qt Creator
    By hqking1988 in forum Qt Tools
    Replies: 8
    Last Post: 12th September 2019, 22:32
  2. cout in Qt
    By qt_developer in forum Newbie
    Replies: 3
    Last Post: 25th May 2012, 22:02
  3. where is cout
    By hqking1988 in forum General Programming
    Replies: 3
    Last Post: 22nd August 2010, 03:35
  4. cout problem
    By mickey in forum General Programming
    Replies: 3
    Last Post: 2nd March 2007, 18:12
  5. How to cout in Qt ?
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 15th December 2006, 00:47

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.