|
QGIS API Documentation
2.8.2-Wien
|
This class manages all known edit widget factories. More...
#include <qgseditorwidgetregistry.h>
Public Member Functions | |
| ~QgsEditorWidgetRegistry () | |
| Destructor. | |
| 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. | |
| 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. | |
| QString | name (const QString &widgetId) |
| Get the human readable name for a widget type. | |
| bool | registerWidget (const QString &widgetId, QgsEditorWidgetFactory *widgetFactory) |
| Register a new widget factory with the given id. | |
Static Public Member Functions | |
| static void | initEditors (QgsMapCanvas *mapCanvas=0, QgsMessageBar *messageBar=0) |
| Registers all the default widgets. | |
| static QgsEditorWidgetRegistry * | instance () |
| This class is a singleton and has therefore to be accessed with this method instead of a constructor. | |
Protected Member Functions | |
| QgsEditorWidgetRegistry () | |
This class manages all known edit widget factories.
Definition at line 32 of file qgseditorwidgetregistry.h.
| QgsEditorWidgetRegistry::~QgsEditorWidgetRegistry | ( | ) |
Destructor.
Deletes all the registered widgets
Definition at line 79 of file qgseditorwidgetregistry.cpp.
|
protected |
Definition at line 71 of file qgseditorwidgetregistry.cpp.
| 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.
| 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) |
Definition at line 84 of file qgseditorwidgetregistry.cpp.
| QgsEditorConfigWidget * QgsEditorWidgetRegistry::createConfigWidget | ( | const QString & | widgetId, |
| QgsVectorLayer * | vl, | ||
| int | fieldIdx, | ||
| QWidget * | parent | ||
| ) |
Creates a configuration widget.
| 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 |
Definition at line 103 of file qgseditorwidgetregistry.cpp.
| const QMap< QString, QgsEditorWidgetFactory * > & QgsEditorWidgetRegistry::factories | ( | ) |
Get access to all registered factories.
Definition at line 122 of file qgseditorwidgetregistry.cpp.
| QgsEditorWidgetFactory * QgsEditorWidgetRegistry::factory | ( | const QString & | widgetId | ) |
Get a factory for the given widget type id.
Definition at line 127 of file qgseditorwidgetregistry.cpp.
|
static |
Registers all the default widgets.
Only call this once on startup of an application.
| mapCanvas | Specify a map canvas with which the widgets (relation reference) work |
| messageBar | Specify a message bar on which messages by widgets will be shown while working with the map canvas |
Definition at line 50 of file qgseditorwidgetregistry.cpp.
|
static |
This class is a singleton and has therefore to be accessed with this method instead of a constructor.
Definition at line 44 of file qgseditorwidgetregistry.cpp.
| QString QgsEditorWidgetRegistry::name | ( | const QString & | widgetId | ) |
Get the human readable name for a widget type.
| widgetId | The widget type to get the name for |
Definition at line 112 of file qgseditorwidgetregistry.cpp.
| bool QgsEditorWidgetRegistry::registerWidget | ( | const QString & | widgetId, |
| QgsEditorWidgetFactory * | widgetFactory | ||
| ) |
Register a new widget factory with the given id.
| widgetId | The id which will be used later to refer to this widget type |
| widgetFactory | The factory which will create this widget type |
Definition at line 132 of file qgseditorwidgetregistry.cpp.
1.8.1.2