Reputation: 948
I am getting confused about qmake. I read that i can include Qt special configuration to the .pro
file like: qt += core
I can also include #include <QtCore>
in my project file.
Is it necessary to make both includes, and why i even need to add the core to the .pro file if can include it in my project file!?
Upvotes: 3
Views: 358
Reputation: 27621
Adding qt+=core is telling Qt which Qt libraries are used for linking (see Declaring Qt Libraries section), whereas using #include pulls in the necessary headers for compilation.
As there are different Qt libraries for different things, it allows you just to use what you need. For example, if you wanted to add networking to an application, you'd add qt+=network to the config and then any necessary headers, such as QTcpSocket.
Upvotes: 6