Control of Qt program and CMD window pop-up

Source: Internet
Author: User
Console when you want to run the program simultaneously in the cmd window, you only need to add it in the pro file (this is a general usage): CONFIG + = console. In general, we all want the cmd window to appear in debug, while the release does not.

 

Console

 

When you want to run the program in the cmd window at the same time, you only need to add it in the pro file (this is a general usage ):

CONFIG += console  

You can.

In general, we all want the cmd window to appear in debug, but the release does not show the cmd window. This is also good for network security.
2009FLY digest, zhengzheng's blog WWW.2009FLY. COM

 

win32:CONFIG(debug, debug|release):CONFIG += console  
  • We want to enable this function only in debug mode under win32.
  • CONFIG (debug, debug | release)For the meaning of the http://hi.baidu.com/cyclone/blog/item/d77a8618608448b94bedbc0b.html content from www.2009fly.com
    2009FLY digest, zhengzheng's blog WWW.2009FLY. COM

Qtestlib

In fact, the cmd window appears not only in the preceding options. When we enable the qtestlib module, the Qt program will also pop up the console window.

WEB technology Ajax, RIA 2009FLY digest, is on the blog WWW.2009FLY. COM

CONFIG + = qtestlib cybersecurity 2009FLY digest, blog: WWW.2009FLY. COM

Or

QT + = testlib game programming 2009FLY digest, blog: WWW.2009FLY. COM
  • I am not quite clear about the origins of these two writing methods. The previous example is the usage of Qt, which is explained by manual of Qt. At present, both of them can be used.

In this case, the pop-up console is actually easy to understand. After all, qtestlib is used for testing. During the test, the pop-up console outputs some intermediate results, which is exactly what everyone expects.

But what if we want to use things in qttestlib in a GUI program without a cmd window?

One way to eliminate cmd (Note: In Qt
A better solution is provided in the article linking subsystems and entry functions in Windows (final version)

  • I don't know if there are other simpler methods, such as adding an option in the pro file (at leastCONFIG-= console).

  • We know that in windows, there are multiple subsystems available for connection. The most common ones are console and windows. The former is out of the console, and the latter is not.
  • Since the console appears after testlib is enabled, that is, it is the console subsystem. If we change it to windows in makefile, the problem will not be solved?

The following describes how to modify the Makefile in the Mingw and VS2008 environments:

  • If mingw is used

Replace the following:

-Wl,-subsystem, console Network Security 2009FLY digest, blog WWW.2009FLY. COM

Changed to the data technology Oracle, DBMaker, DB2 2009FLY digest, is blog WWW.2009FLY. COM

-Wl,-subsystem,windows  

Recompile

  • If VS2008 and other compilers are used, game programming
    2009FLY digest, zhengzheng's blog WWW.2009FLY. COM

In this example, the operating system kernel 2009FLY digest is published on WWW.2009FLY. COM.

/SUBSYSTEM: CONSOLE mobile development, Android, iPhone 2009FLY digest, zhengzheng blog WWW.2009FLY. COM

Change

/SUBSYSTEM: WINDOWS/entry: mainCRTStartup 2009FLY digest, WWW.2009FLY. COM

You can.

For a simple discussion of the linked subsystem, you can look at this: http://hi.baidu.com/cyclone/blog/item/96624a90fb4ca081a977a4db.html

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.