foreach (QObject *plugin, QPluginLoader::staticInstances())
populateMenus(plugin);
void MainWindow::populateMenus(QObject *plugin)
{
BrushInterface *iBrush = qobject_cast<BrushInterface *>(plugin);
if (iBrush)
addToMenu(plugin, iBrush->brushes(), brushMenu, SLOT(changeBrush()),
brushActionGroup);
ShapeInterface *iShape = qobject_cast<ShapeInterface *>(plugin);
if (iShape)
addToMenu(plugin, iShape->shapes(), shapesMenu, SLOT(insertShape()));
FilterInterface *iFilter = qobject_cast<FilterInterface *>(plugin);
if (iFilter)
addToMenu(plugin, iFilter->filters(), filterMenu, SLOT(applyFilter()));
}