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