Results 1 to 6 of 6

Thread: Output to terminal

  1. #1
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Output to terminal

    Hi I'm brand new to Qt, hence the forum, and having troubles running a tester hello world program.
    I used create project - console project.
    Qt Code:
    1. #include <QtCore/QCoreApplication>
    2. #include <QDebug>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QCoreApplication a(argc, argv);
    7. qDebug() << "Hello World";
    8.  
    9. return a.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    This builds ok and runs with no errors but the terminal doesn't output any text.
    When I tried not outputting to console it outputted into the application output window fine.
    I'm not sure what to check next, any help is much appreciated.
    I'm on UBUNTU 12.04

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Output to terminal

    How do you run this application?
    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.


  3. #3
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Output to terminal

    I just click on the little green run button. The Ctrl R shortcut one.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Output to terminal

    In other words you launch it from Qt Creator. And the "Application Output" (or whatever it's called in English) pane remains empty? What happens if you run the app from within a terminal?
    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
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Output to terminal

    Yes, it is called "Application Output"

    If the Qt Creator Run Settings for the project are "Run in terminal" and the terminal program cannot be launched then you get no output. The terminal command can be found Under the Tools menu, Options..., Environment page, General tab. On my machine it is "xterm -e" but I think Ubuntu puts something non-functional in there (there's a recent similar post).

    You could also turn off the Run In Terminal option if your program does not require user keyboard input: all output will then go into the "Application Output" pane.

  6. The following user says thank you to ChrisW67 for this useful post:

    wookie1 (12th June 2012)

  7. #6
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Output to terminal

    That's solved it, thanks.

Similar Threads

  1. not able to read output from the terminal
    By jack101 in forum Qt Programming
    Replies: 3
    Last Post: 26th March 2012, 17:53
  2. Replies: 3
    Last Post: 27th August 2011, 21:44
  3. software that can't be run from a terminal
    By Gh0str1d3r in forum Qt Programming
    Replies: 8
    Last Post: 7th October 2010, 13:29
  4. Terminal into Qt application
    By paF4uko in forum Qt Programming
    Replies: 4
    Last Post: 27th February 2009, 11:22
  5. help about terminal window
    By andyyeng in forum Qt Programming
    Replies: 0
    Last Post: 29th October 2008, 15:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.