tags:

views:

108

answers:

2

What is a QT Plugin? What are differences between a qt plugin and a custom made qt library?

Thanks.

+2  A: 

The feature you call a Qt Plugin is formally a framework inside Qt that allows developers to propose a plugin system for their application. Qt Plugin handles the dynamic loading of the plugins that can be used through the plugin interface by the application. You can look at Qt Plugin documentation for more information and examples.

Lohrun
+3  A: 

AFAIK Qt plugins are implemented as shared libraries (.so on Unix/Linux and DLLs on Windows). The differences between them are the same as with plugins and libraries in general.

What this means is that, a plug-in architecture is independent of the linking method. They tend to be thought of as plug-in/dynamic linking and non-plug-in/static linking.

A core application specifies an interface and data exchange contract (i.e. an API) through which separate modules can interact with the application and expose functionality through the application. Just shipping new modules in DLLs does not address the need of a way for the application itself to discover these DLLs and to know how to execute the logic within. This is the essence of a plugin architecture. In general, DLL's expose only a list of procedures or functions. Variables, classes, objects inside the dll are not directly accessible to outside processes. Writing a plugin involves moving most or all of the relevant code into the DLL, where all variables and objects can be directly referenced.

Something like Eclipse, wherein you place you plugin in a pre-defined directory and the next time you click on some Menu you see new entries. All this without restarting your app or running a new version of the exe.

Abhay