Qt Project (.pro) File

I'm sure you already know about the Qt Project File since we have mentioned it countless times throughout the book. A .pro file is actually the project file used by qmake to build your application, library, or plugin. It contains all the information, such as links to the headers and source files, libraries required by the project, custom-build processes for different platforms/environments, and so on. A simple project file could look something like this:

QT += core gui widgets 
 
TARGET = MyApp 
TEMPLATE = app 
 
SOURCES +=  
        main.cpp  
        mainwindow.cpp 
 
HEADERS +=  
        mainwindow.h 
 
FORMS +=  
        mainwindow.ui 
 
RESOURCES +=  
    resource.qrc 

It simply tells qmake which Qt modules should be included in the project, what the name of the executable program is, what's the type of the application, and finally the links to the header files, source files, form declaration files, and resource files that need to be included in the project. All of this information is crucial in order for qmake to generate the configuration files and successfully build the application. For a more complex project, you may want to configure your project differently for different operating systems. This can also be done easily in the Qt Project File.

To learn more about how you can configure your project differently for different operating systems, please refer to the following link: http://doc.qt.io/qt-5/qmake-language.html#scopes-and-conditions.