Plug & Paint Extra Filters Example¶
A plugin providing the extra filters.
Since the approach is identical to Basic Tools , we won’t review the code here. The only part of interest is the
.profile, since Extra Filters is a dynamic plugin ( Basic Tools is linked statically into the Plug & Paint executable).
Here’s the project file for building the Extra Filters plugin:<Code snippet "tools/plugandpaint/plugins/extrafilters/extrafilters.pro:0" not found>
.profile differs from typical
.profiles in many respects. First, it starts with a
lib. (The default template is
app.) It also adds
CONFIGvariable. This is necessary on some platforms to avoid generating symbolic links with version numbers in the file name, which is appropriate for most dynamic libraries but not for plugins.
INCLUDEPATHvariable sets the search paths for global headers (i.e., header files included using
#include <...>). We add
../../appto the list, so that we can include
TARGETvariable specifies which name we want to give the target library. We use
pnp_as the prefix to show that the plugin is designed to work with Plug & Paint. On Unix,
libis also prepended to that name. On all platforms, a platform-specific suffix is appended (e.g.,
DESTDIRvariable specifies where we want to install the plugin. We put it in Plug & Paint’s
pluginssubdirectory, since that’s where the application looks for dynamic plugins.
CONFIG()code at the end is necessary for this example because the example is part of the Qt distribution and Qt can be configured to be built simultaneously in debug and in release modes. You don’t need to for your own plugins.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.