Results 1 to 4 of 4

Thread: capture information to the command line qt4

  1. #1
    Join Date
    Aug 2006
    Location
    troy, new york
    Posts
    24
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default capture information to the command line qt4

    hi,
    i tried std::cout/std::cerr, no luck. so, is there a qt class that allows messages to be echoed to the command line at runtime. i'm trying to catch events that effect some decision chains i'm using. thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: capture information to the command line qt4

    You should use qDebug if it is for debugging. Simply include QtDebug and do something like this:
    Qt Code:
    1. qDebug() << "test";
    To copy to clipboard, switch view to plain text mode 
    .

    If you are using the Windows version of Qt you might want to add a line to the pro-file of you project.

    Qt Code:
    1. CONFIG += console
    To copy to clipboard, switch view to plain text mode 

    Without this one, you will not see anything.

  3. The following user says thank you to e8johan for this useful post:

    nikita (5th September 2006)

  4. #3
    Join Date
    Aug 2006
    Location
    troy, new york
    Posts
    24
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: capture information to the command line qt4

    thanks again, i also found a workaround with cerr, but i needed qDebug for what i'm doing. take care.

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

    Default Re: capture information to the command line qt4

    cout/cerr works too. Just make sure there is something to output to (CONFIG+=console).

Similar Threads

  1. Replies: 13
    Last Post: 1st June 2006, 14:01
  2. Capture a keyboard event
    By mahe2310 in forum Qt Programming
    Replies: 8
    Last Post: 16th February 2006, 11:19

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.