Results 1 to 6 of 6

Thread: Is there any way to see printf when using VS2005 and Qt?

  1. #1
    Join Date
    Apr 2009
    Posts
    132
    Thanks
    67
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Wink Is there any way to see printf when using VS2005 and Qt?

    Hi!

    I'm using Qt 4.5, VS2005 and VS integration plugin. Is there any way to see what printf prints just for debug purposes? (or a similar method)

    Thanks for help.

  2. #2
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is there any way to see printf when using VS2005 and Qt?

    I do the following:

    1. add this to my .pro file

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

    after re-compiling your code, the app should open with a DOS console


    2. use qDebug to send output to console

    Qt Code:
    1. qDebug("show index: %d", myIndexVal);
    2.  
    3. // or
    4.  
    5. qDebug() << "show index: " << myIndexVal;
    To copy to clipboard, switch view to plain text mode 

    Using the latter option: I think you have to #include <QDebug> (not sure, i rarely use it).

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

    ricardo (26th April 2009)

  4. #3
    Join Date
    Apr 2009
    Posts
    132
    Thanks
    67
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there any way to see printf when using VS2005 and Qt?

    Thanks for reply.

    I'm using Visual Studio and VS pluging and I don't see any .pro file.
    (I'm a beginner)

    Any idea?

    Thanks.

  5. #4
    Join Date
    Apr 2009
    Posts
    132
    Thanks
    67
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there any way to see printf when using VS2005 and Qt?

    Forget it!

    qDebug sends the message to VS Debug Console. SO it is perfect for me. Thanks.

  6. #5
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is there any way to see printf when using VS2005 and Qt?

    oops: i posted something, then saw you had it. So nevermind

  7. #6
    Join Date
    Apr 2009
    Posts
    132
    Thanks
    67
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there any way to see printf when using VS2005 and Qt?

    Anyway, if anyboy knows how to get a DOS console in my case, it would be nice. Just curiosity.

    Thanks.

Similar Threads

  1. Problem building qt embedded for WinCE and VS2005
    By high_flyer in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 5th June 2009, 01:04
  2. Replies: 5
    Last Post: 19th September 2008, 15:24
  3. WCHAR to QString giving error in vs2005
    By ucomesdag in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2008, 23:25
  4. Qt toolbar for VS2005
    By fruzzo in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd December 2007, 20:25
  5. Installing Qt 4.1.4 (open source) on windows with vs2005
    By Randulf in forum Installation and Deployment
    Replies: 1
    Last Post: 19th August 2006, 12:22

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.