On 23 Jan 2012, at 10:58, ext [email protected] wrote: > > On 20 Jan 2012, at 12:57, ext Mathias Hasselmann wrote: > >> Hi, >> >> 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 >> should have: >> >> 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. > > The plugin manager of Qt Creator might be a good starting point. It has been > created with the possibility in mind that this might be of more general > interest, and should have no dependency on Qt Creator itself. > > * iterates directories for plugin specification files, that describe plugins > to be loaded, their license, vendor, description, webpage, etc > * plugin dependencies & versioning > * plugins can register for command line arguments > * plugin life cycle management > * object registry where objects implementing (qobject based) interfaces can > be registered, and retrieved by type, object name and type name.
https://qt.gitorious.org/qt-creator/qt-creator/trees/master/src/libs/extensionsystem http://doc.qt.nokia.com/qtcreator-extending/creating-plugins.html (fwiw) -- Eike Ziller Principal Software Engineer Nokia, Qt Development Frameworks Nokia gate5 GmbH Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B Umsatzsteueridentifikationsnummer: DE 812 845 193 Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
