[scribus] making a plugin depend on another plugin
Franz Schmid
Franz.Schmid at altmuehlnet.de
Tue Mar 3 20:03:42 UTC 2015
Am 02.03.2015 um 20:12 schrieb ale rimoldi:
> hi
>
> can anybody give me a hint, on how to -- correctly -- make a plugin
> depend on another plugin and, then make calls from the first to the
> second?
>
> i could not find any examples in the code...
Hello Ale,
below is an example how to call the "subdivide" plugin from the
tools plugins.
// Plugin names are lowercase
QString pName = "subdivide";
// get list of installed plugins
PluginManager& pluginManager(PluginManager::instance());
QStringList pluginNames(pluginManager.pluginNames(false));
// if your plugin is in the list
if (pluginNames.contains(pName))
{
// get the plugin
ScActionPlugin* plugin = dynamic_cast<ScActionPlugin*>
(pluginManager.getPlugin(pName, false));
// now you can call the plugins "run" method
// with your doc as argument
if (plugin)
plugin->run(doc);
}
Hope that helps.
Greetings,
Franz Schmid
More information about the scribus
mailing list