QT Pro Files

Source: Internet
Author: User

in the Qt of the . Pro There are many variables and functions in the file, and here are some common ones.

two consecutive dollar signs $$ , which can be used to access the variables listed below, such as $ $SOURCES . Code comments begin with # .

SOURCES + = Xxx.cpp

SOURCES Statement . cpp file.

HEADERS + = Xxx.h

HEADERS Statement . h file.

Includepath + = Include_path

Includepath Statement #include The path used to search for this path when compiling the project.

Dependpath + = Depend_path

Dependpath Statement include the dependent directory of the file.

LIBS + = Some_libs

LIBS A declaration is linked to a library in the project.

RESOURCES + = XXX.QRC

RESOURCES Statement . QRC file.

FORMS + = Xxx.ui

FORMS Statement . UI file, before compiling by the UIC processing.

TARGET = Target_name

TARGET Specifies the executable file name.

DESTDIR = Target_path

DESTDIR Specifies the path to the executable file.

TEMPLATE = Template_name

TEMPLATE declaring project type , such as app , lib , subdirs

QT + = Used_module

QT declaration project used in qt module, add by default core gui module.

CONFIG + = Debug

CONFIG represents a project configuration and some compilation options, where Debug represents an application to Debug mode to compile.

Defines + = Custom_variable

defines Use the to Customize the preprocessing macro variables.

Win32 {

SOURCES + = Xxx_win.cpp

}

UNIX {

SOURCES + = Xxx_unix.cpp

}

Win32 and the Unix represents the platform-related.

Win32 {

Debug {

CONFIG + = Console

}

}

Win32:debug {

CONFIG + = Console

}

aboveWin32underDebugthe two representations result in the same wayCONFIGadded aDebug, the contents of the curly braces are executed, givingCONFIGAdd againConsole, can be used toQdebug ()and so on.Logoutput.

Include (filename)

include () function is used in the current file include Parameters filename Specifies the contents of the file.

!exists (main.cpp) {

Error ("No main.cpp file found")

}

exists ( function to determine whether a file exists, supports ! reverse operation, error () function output some information and stop qmake Span style= "Font-family:wenquanyi Micro Hei" > process.

CONFIG ( config_name)

CONFIG ( function to detect config is the variable added config_name Span style= "Font-family:wenquanyi Micro Hei" > if judge.



QT Pro Files

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.