Results 1 to 7 of 7

Thread: Activating Console in VS2008 Qt Integration Gui App

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Activating Console in VS2008 Qt Integration Gui App

    Hi,

    i have a Win32 Qt Gui App build with VS2008 and the Qt VS Integration. Now i face crashes in Release mode, while Debug mode runs fine. Therefore i'd like to have messages in the console in release mode, but std::cout seems to be indirected into nowhere... I assume i have to state

    CONFIG += console

    somewhere, but where? I'm building inside VS2008...

    Thanks for any help,

    Sebastian

  2. #2
    Join Date
    Dec 2010
    Location
    Omaha, NE
    Posts
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Activating Console in VS2008 Qt Integration Gui App

    Try including the following header:

    #include <QtDebug>

    And then you can place debug statements like the following:

    qDebug() << "Some out string";

    Which uses the std::cout stream insertion format. The output will show up in the Visual Studio output window - no need for console.

  3. #3
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Activating Console in VS2008 Qt Integration Gui App

    Quote Originally Posted by johnc View Post
    qDebug() << "Some out string";
    ...
    The output will show up in the Visual Studio output window - no need for console.
    Thanks. But i need debug messages in release mode, when my App is running outside VS2008 (and therefore, there is no VS outout window)...

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Activating Console in VS2008 Qt Integration Gui App

    The config += console needs to go in your .pro file

  5. #5
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Activating Console in VS2008 Qt Integration Gui App

    Quote Originally Posted by tbscope View Post
    The config += console needs to go in your .pro file
    Well, basically, i don't have a .pro file, because i used Qt Visual Studio Integration from the scratch...

    I did the following test now which is like my approach:

    - created a Qt Application in VS 2008 by the Qt Visual Studio integration
    - created a basic .pro file from within VS 2008
    - added CONFIG+= console
    - closed my VS2008 .sln file and opened the .pro file in VS 2008

    Well, besides that rcc fires an error now, i have the /SUBSYSTEM:CONSOLE in my linker switches now, but this is not what i want, because it makes my App to a console application.

    Hmm. Seems to be difficult. From gtkmm i know that it is possible to have a Win32 Gui application with console i/o....

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Activating Console in VS2008 Qt Integration Gui App

    Then I don't think this has anything to do with Qt.
    See the Visual Studio documentation on how to open a debugging console.

  7. #7
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Activating Console in VS2008 Qt Integration Gui App

    Quote Originally Posted by tbscope View Post
    Then I don't think this has anything to do with Qt.
    You're right. The link below solved the problem for me, in case anybody else here needs the same (Win Gui App with console):

    http://www.halcyon.com/~ast/dload/guicon.htm

    Thanks Sebastian

Similar Threads

  1. Precent QDialog from de-activating mainwindow
    By Arthur in forum Qt Programming
    Replies: 0
    Last Post: 6th October 2010, 12:01
  2. selecting/activating tabify'd DockWidget?
    By iraytrace in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2010, 18:44
  3. Activating multiple windows
    By lixo1 in forum Qt Programming
    Replies: 2
    Last Post: 12th May 2009, 20:54
  4. Qt4 integration with VS2008 Express how-to interest?
    By thomaspu in forum Qt Programming
    Replies: 11
    Last Post: 21st May 2008, 12:53
  5. Help sought on console + GUI Integration...
    By mysearch05 in forum Newbie
    Replies: 7
    Last Post: 28th January 2006, 14:41

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
  •  
Qt is a trademark of The Qt Company.