[Marble-devel] Re: programmatically adding an AbstractDataPlugin to MarbleWidget?
bbeschow at cs.tu-berlin.de
Thu Mar 31 18:15:23 CEST 2011
Am Donnerstag, 31. März 2011, 11:39:08 schrieb Ákos Maróy:
> I'm trying to programmatically add my on subclass of AbstractDataPlugin
> to a MarbleWidget instances, but I'm not finding a way to do so.
Nice to hear about that use case.
> What I'm looking for is to create my own AbstractDataPlugin subclass,
> say FooPlugin, and add it to a MarbleWidget through code - that is, not
> through the shared object based plugin loading mechanism.
> I've been looking at the API docs and source code, and it seems that one
> cannot call widget->map()->addLayer(), as MarbleWidget::map() is a const
> function (consider widget of beinga MarbleWidget * type). I cannot
> explicitly make PluginManager add my plugin object to the list of
> available plugins either.
> I wonder what is the proper way of adding a custom plugin to an existing
> MarbleWidget object?
Have you tried adding your plugin by means of MarbleMap::addLayer()? AbstractDataPlugin inherits from LayerInterface, which is what this method expects.
BTW, which version of libmarble do you target? Do you intend to target future versions of libmarble as well?
More information about the Marble-devel