PDA

View Full Version : How to cout in Qt ?



probine
14th December 2006, 17:00
I want to print messages in the console in Windows.

How do I do it with cout << ?

jpn
14th December 2006, 17:05
Check this thread (http://www.qtcentre.org/forum/f-qt-programming-2/t-qdebug-under-windows-4102.html#2).

Gopala Krishna
14th December 2006, 17:06
I want to print messages in the console in Windows.

How do I do it with cout << ?
Try qDebug( ) instead.

hyling
14th December 2006, 23:56
This is a cool trick I learned from someone on the forums. Assuming you're using Visual Studio, if you go to the Project Properties and set configuration properties>Linker>System>SubSystem to "Console" your application will show a console and cout << will be displayed in the console. I usually use this for my debug project and return the subsystem to windows for my release projects.

HTH
Hua-Ying :)

wysota
15th December 2006, 00:47
This is a cool trick I learned from someone on the forums. Assuming you're using Visual Studio, if you go to the Project Properties and set configuration properties>Linker>System>SubSystem to "Console" your application will show a console and cout << will be displayed in the console. I usually use this for my debug project and return the subsystem to windows for my release projects.


This is equivalent of writing:


win32 {
release:CONFIG -= console
debug:CONFIG += console
}

in the project file.