Creating your plugins

The SDK was painless to create. We can now proceed to create our first plugin. We already know that all our plugins will include the SDK we just completed. Fortunately, this can be easily factorized in a .pri file (PRoject Include). A .pri file behaves exactly like a .pro file; the only difference is that it is intended to be included inside .pro files.

In the ch08-image-animation directory, create a file named plugins-common.pri that contains the following code:

INCLUDEPATH += $$PWD/sdk 
DEPENDPATH += $$PWD/sdk 

This file will be included in each .pro plugin. It aims to tell the compiler where it can find the headers of the SDK and where to look to resolve dependencies between headers and sources. This will enhance the ...

Get End to End GUI Development with 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.