Results 1 to 2 of 2

Thread: Print with iostream to console

  1. #1
    Join Date
    Jul 2008
    Posts
    48
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Print with iostream to console

    Hi everyone,

    I was wondering if it is possible to print output to the command line while running a gui, I have tried using iostream... cout << .. but it doesn't work. Is there something specific I have to do in the main that starts the application.. this is what it looks like:

    Qt Code:
    1. #include <QApplication>
    2. #include "mainwindow.h"
    3.  
    4. int main (int argc, char *argv[])
    5. {
    6. QApplication app( argc, argv );
    7. MainWindow main;
    8. main.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Print with iostream to console

    You will need to add
    CONFIG += console to your .pro file

Similar Threads

  1. how to print a matrix to a console in GUI program
    By elflord in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2009, 12:16
  2. Handling unixSignal in PyQt in a console app
    By null in forum Qt Programming
    Replies: 0
    Last Post: 26th January 2009, 23:59
  3. convert console to windows app
    By Max Yaffe in forum Newbie
    Replies: 1
    Last Post: 13th June 2007, 15:38
  4. Console replacement
    By aegis in forum Qt Programming
    Replies: 14
    Last Post: 3rd April 2007, 00:38
  5. How to run a console program "silently"?
    By fullmetalcoder in forum Qt Programming
    Replies: 9
    Last Post: 23rd July 2006, 10:03

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.