[Development] Let's discuss QPluginManager
mathias at openismus.com
Fri Jan 20 12:57:23 CET 2012
Qt nicely supports extending applications and libraries via plugins,
still in my opinion one major building block is missing: Some reusable
object which iterates the shared object files in relevant plugin folders
and returns all instances implementing a given set of interfaces. This
seems a pretty common task.
Just had to think about implementing such a thing today. Yes, once
again. Actually rather wondered from where to copy-and-paste it: I've
stopped counting how many of them I touched during the last two years.
Something that's even worse than the need of copy-and-paste: Most of
them were created with some kind of ad-hoc mentality, so of course most
of them are highly inefficient, if not even plainly broken.
Hope you still reading and got somewhat hooked. Also hope you agree we
need something like QPluginManager, so let's discuss the feature set it
1. Iterate relevant plugin folders to find plugins implementing a
given set of QObject interfaces.
2. Introspect as few plugin files as possible to keep application
startup time low. This could be done by caching the interfaces
each plugin file provides.
3. Do we need meta informations like vendor name, description or
dependencies? Think of QtCreator's .pluginspec files.
Once we figured out the needed feature set, we should figure out how to
implement the object. Most importantly: Is there some code, are there
some specifications we could reuse?
Guess this should be enough to get the discussion started.
Mathias Hasselmann <mathias at openismus.com>
More information about the Development