This class manages all known edit widget factories.
More...
#include <qgseditorwidgetregistry.h>
Public Member Functions |
| ~QgsEditorWidgetRegistry () |
QgsEditorWidgetWrapper * | 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.
|
QgsEditorConfigWidget * | createConfigWidget (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.
|
QgsEditorWidgetFactory * | factory (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 QgsEditorWidgetRegistry * | instance () |
| This class is a singleton and has therefore to be accessed with this method instead of a constructor.
|
Detailed Description
This class manages all known edit widget factories.
Constructor & Destructor Documentation
QgsEditorWidgetRegistry::~QgsEditorWidgetRegistry |
( |
| ) |
|
QgsEditorWidgetRegistry::QgsEditorWidgetRegistry |
( |
| ) |
|
|
protected |
Member Function Documentation
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
-
widgetId | The id of the widget type to create an attribute editor for |
vl | The vector layer for which this widget will be created |
fieldIdx | The field index on the specified layer for which this widget will be created |
config | A configuration which should be used for the widget creation |
editor | An editor widget which will be used instead of an autocreated widget |
parent | The parent which will be used for the created wrapper and the created widget |
context | The editor context (not available in python bindings) |
- Returns
- A new widget wrapper
Creates a configuration widget.
- Parameters
-
widgetId | The id of the widget type to create a configuration widget for |
vl | The vector layer for which this widget will be created |
fieldIdx | The field index on the specified layer for which this widget will be created |
parent | The parent widget for the created widget |
- Returns
- A new configuration widget
Get access to all registered factories.
- Returns
- All ids and factories
Get a factory for the given widget type id.
- Returns
- A factory or Null if not existent
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
-
widgetId | The 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
-
widgetId | The id which will be used later to refer to this widget type |
widgetFactory | The 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: