QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsEditorWidgetRegistry Class Reference

This class manages all known edit widget factories. More...

#include <qgseditorwidgetregistry.h>

Public Member Functions

 ~QgsEditorWidgetRegistry ()
QgsEditorWidgetWrappercreate (const QString &widgetId, QgsVectorLayer *vl, int fieldIdx, const QgsEditorWidgetConfig &config, QWidget *editor, QWidget *parent, const QgsAttributeEditorContext context=QgsAttributeEditorContext())
 Create an attribute editor widget wrapper of a given type for a given field.
QgsEditorConfigWidgetcreateConfigWidget (const QString &widgetId, QgsVectorLayer *vl, int fieldIdx, QWidget *parent)
 Creates a configuration widget.
QString name (const QString &widgetId)
 Get the human readable name for a widget type.
const QMap< QString,
QgsEditorWidgetFactory * > & 
factories ()
 Get access to all registered factories.
QgsEditorWidgetFactoryfactory (const QString &widgetId)
 Get a factory for the given widget type id.
bool registerWidget (const QString &widgetId, QgsEditorWidgetFactory *widgetFactory)
 Register a new widget factory with the given id.

Static Public Member Functions

static QgsEditorWidgetRegistryinstance ()
 This class is a singleton and has therefore to be accessed with this method instead of a constructor.

Protected Member Functions

 QgsEditorWidgetRegistry ()

Detailed Description

This class manages all known edit widget factories.

Constructor & Destructor Documentation

QgsEditorWidgetRegistry::~QgsEditorWidgetRegistry ( )
QgsEditorWidgetRegistry::QgsEditorWidgetRegistry ( )
protected

Member Function Documentation

QgsEditorWidgetWrapper * QgsEditorWidgetRegistry::create ( const QString &  widgetId,
QgsVectorLayer vl,
int  fieldIdx,
const QgsEditorWidgetConfig config,
QWidget *  editor,
QWidget *  parent,
const QgsAttributeEditorContext  context = QgsAttributeEditorContext() 
)

Create an attribute editor widget wrapper of a given type for a given field.

The editor may be NULL if you want the widget wrapper to create a default widget.

Parameters
widgetIdThe id of the widget type to create an attribute editor for
vlThe vector layer for which this widget will be created
fieldIdxThe field index on the specified layer for which this widget will be created
configA configuration which should be used for the widget creation
editorAn editor widget which will be used instead of an autocreated widget
parentThe parent which will be used for the created wrapper and the created widget
contextThe editor context (not available in python bindings)
Returns
A new widget wrapper
QgsEditorConfigWidget * QgsEditorWidgetRegistry::createConfigWidget ( const QString &  widgetId,
QgsVectorLayer vl,
int  fieldIdx,
QWidget *  parent 
)

Creates a configuration widget.

Parameters
widgetIdThe id of the widget type to create a configuration widget for
vlThe vector layer for which this widget will be created
fieldIdxThe field index on the specified layer for which this widget will be created
parentThe parent widget for the created widget
Returns
A new configuration widget
const QMap< QString, QgsEditorWidgetFactory * > & QgsEditorWidgetRegistry::factories ( )

Get access to all registered factories.

Returns
All ids and factories
QgsEditorWidgetFactory * QgsEditorWidgetRegistry::factory ( const QString &  widgetId)

Get a factory for the given widget type id.

Returns
A factory or Null if not existent
QgsEditorWidgetRegistry * QgsEditorWidgetRegistry::instance ( )
static

This class is a singleton and has therefore to be accessed with this method instead of a constructor.

Returns
QString QgsEditorWidgetRegistry::name ( const QString &  widgetId)

Get the human readable name for a widget type.

Parameters
widgetIdThe widget type to get the name for
Returns
A human readable name
bool QgsEditorWidgetRegistry::registerWidget ( const QString &  widgetId,
QgsEditorWidgetFactory widgetFactory 
)

Register a new widget factory with the given id.

Parameters
widgetIdThe id which will be used later to refer to this widget type
widgetFactoryThe factory which will create this widget type
Returns
true, if successful, false, if the widgetId is already in use or widgetFactory is NULL

The documentation for this class was generated from the following files: