Show console after running non-GUI-QT program (easy to use)

Source: Internet
Author: User

~ ~ ~ My life, my little drops!!

There are times when we add a good debug message to the program to make it easier for the program to print out some of the information we need during the run or to use it to display some of the necessary information.

Then console is too important, once I always thought GUI program can not console parallel, later search is can, although can only display information, but that is enough,

Since I'm using QT to write applications, I'll explain how to set them in two different editors:

1. Qt Creator-pro Project file

Open Project file Pro, adding: CONFIG + = Console

[CPP]View PlainCopy
    1. HEADERS = Mainwindow.h
    2. SOURCES = Mainwindow.cpp
    3. RESOURCES = DIAGRAMSCENE.QRC
    4. CONFIG + = Console


It is relatively simple to set up pro files in Qt Creator, but many times we have to write QT-related code in VS, what about this time?

2, VS2008 + qt-vcproj project documents

Modify the project Properties configuration Linker------> System------> SubSystem

Put Windows (/subsystem:windows)------>console (/subsystem:console)

When the setup is complete, it will show the output information with console control, is it cool ^v^

http://blog.csdn.net/ac_huang/article/details/38919809

Show console after running non-GUI-QT program (easy to use)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.