83 qDeleteAll( mWidgetFactories.
values() );
88 if ( mWidgetFactories.
contains( widgetId ) )
107 if ( mWidgetFactories.
contains( widgetId ) )
126 if ( mWidgetFactories.
contains( widgetId ) )
128 return mWidgetFactories[widgetId]->configWidget( vl, fieldIdx, parent );
135 if ( mWidgetFactories.
contains( widgetId ) )
137 return mWidgetFactories[widgetId]->name();
145 return mWidgetFactories;
150 return mWidgetFactories.
value( widgetId );
155 if ( !widgetFactory )
160 else if ( mWidgetFactories.
contains( widgetId ) )
167 mWidgetFactories.
insert( widgetId, widgetFactory );
180 Q_ASSERT( vectorLayer );
184 for (
int i = 0; i < editTypeNodes.
size(); i++ )
186 QDomNode editTypeNode = editTypeNodes.
at( i );
205 ewv2Type = readLegacyConfig( vectorLayer, editTypeElement, cfg );
209 ewv2Type = editTypeElement.
attribute(
"widgetv2type" );
211 if ( mWidgetFactories.
contains( ewv2Type ) )
216 if ( !ewv2CfgElem.
isNull() )
218 cfg = mWidgetFactories[ewv2Type]->readEditorConfig( ewv2CfgElem, vectorLayer, idx );
262 if ( !mWidgetFactories.
contains( widgetType ) )
271 editTypeElement.
setAttribute(
"widgetv2type", widgetType );
273 if ( mWidgetFactories.
contains( widgetType ) )
279 mWidgetFactories[widgetType]->writeConfig( vectorLayer->
editorWidgetV2Config( idx ), ewv2CfgElem, doc, vectorLayer, idx );
290 void QgsEditorWidgetRegistry::mapLayerAdded(
QgsMapLayer* mapLayer )
301 void QgsEditorWidgetRegistry::readSymbology(
const QDomElement& element,
QString& errorMessage )
303 Q_UNUSED( errorMessage )
308 readMapLayer( vl, element );
313 Q_UNUSED( errorMessage )
318 writeMapLayer( vl, element, doc );
const QgsEditorWidgetConfig editorWidgetV2Config(int fieldIdx) const
Get the configuration for the editor widget used to represent the field at the given index...
const QString & name() const
Gets the name of the field.
bool fieldEditable(int idx)
is edit widget editable
Base class for all map layer types.
QgsMapLayer::LayerType type() const
Get the type of the layer.
bool contains(const Key &key) const
QList< T > values() const
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
This class contains context information for attribute editor widgets.
#define Q_NOWARN_DEPRECATED_PUSH
A bar for displaying non-blocking messages to the user.
QDomNodeList childNodes() const
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
static void logMessage(QString message, QString tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)
QDomElement toElement() const
const char * name() const
void setAttribute(const QString &name, const QString &value)
const QString editorWidgetV2(int fieldIdx) const
Get the id for the editor widget used to represent the field at the given index.
int toInt(bool *ok, int base) const
int count() const
Return number of items.
Encapsulate a field in an attribute table or data source.
bool labelOnTop(int idx)
label widget on top
QDomNode namedItem(const QString &name) const
void setEditorWidgetV2Config(int attrIdx, const QgsEditorWidgetConfig &config)
Set the editor widget config for a field.
#define Q_NOWARN_DEPRECATED_POP
void setEditorWidgetV2(int attrIdx, const QString &widgetType)
Set the editor widget type for a field.
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
static Q_DECL_DEPRECATED const QString convertEditType(QgsVectorLayer::EditType editType, QgsEditorWidgetConfig &cfg, QgsVectorLayer *vl, const QString &name, const QDomElement &editTypeElement=QDomElement())
static QgsMessageLog * instance()
static QgsProject * instance()
access to canonical QgsProject instance
void setFieldEditable(int idx, bool editable)
set edit widget editable
iterator insert(const Key &key, const T &value)
const QgsFields & pendingFields() const
returns field list in the to-be-committed state
void setLabelOnTop(int idx, bool onTop)
label widget on top
QDomElement createElement(const QString &tagName)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
QDomNode at(int index) const
const T value(const Key &key) const