All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MultiWidgets::Plugins Class Reference

Class that handles plugin loading and instantation. More...

#include <MultiWidgets/Plugins.hpp>

Public Member Functions

OperatorPtr createOperator (const QString &id)
 Create an instance of an operator based on the unique identifier. More...
 
WidgetPtr createPluginWidget (const QString &id)
 Creates a plugin widget based on the unique identifier. More...
 
QStringList pluginIdList ()
 Returns a list of all plugin identifiers.
 
template<typename T >
QByteArray pluginName ()
 Get the plugin name from class. More...
 
template<typename T >
QByteArray pluginName (const T *t)
 Get the plugin name from instance Widget * w = new ImageWidget; pluginName(w) == "cornerstone.imagewidget".
 
void scanDirectories ()
 Scans the default directories for plugins.
 
void scanDirectory (const QString &name)
 Scans a given directory, and loads all plugins that are to be found.
 

Static Public Member Functions

static void CONCAT (checkAPI, CORNERSTONE_VERSION)()
 API compatibility check function. More...
 
static TypeidMap & typeidMap ()
 

Detailed Description

Class that handles plugin loading and instantation.

Member Function Documentation

static void MultiWidgets::Plugins::CONCAT ( checkAPI  ,
CORNERSTONE_VERSION   
)
static

API compatibility check function.

This function is used by the plugin factory functions to verify that the current Cornerstone run-time matches the plugin version. The name of this function is changed for each new release, so that it becomes unavailable to plugins that have been compiled against an older (or newer) version of Cornerstone.

OperatorPtr MultiWidgets::Plugins::createOperator ( const QString &  id)

Create an instance of an operator based on the unique identifier.

Parameters
idid of the operator to instanciate
Returns
instance of the operator
WidgetPtr MultiWidgets::Plugins::createPluginWidget ( const QString &  id)

Creates a plugin widget based on the unique identifier.

Parameters
idid of the plugin to create
Returns
instance of the plugin or 0 if no plugin was found
template<typename T >
QByteArray MultiWidgets::Plugins::pluginName ( )
inline

Get the plugin name from class.

Get the name of a plugin pluginName<MultiWidgets::ImageWidget> == "cornerstone.imagewidget"

Returns
the id for the plugin