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 ...

Get Hands-On GUI Programming with C++ and Qt5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.