22 QString widgetType =
"TextEdit";
28 widgetType =
"ValueMap";
31 for (
int j = 0; j < valueMapNodes.
size(); j++ )
42 cfg.
insert(
"Style",
"Edit" );
51 widgetType =
"SliderRange";
52 cfg.
insert(
"Style",
"Slider" );
61 widgetType =
"DialRange";
62 cfg.
insert(
"Style",
"Dial" );
71 widgetType =
"CheckBox";
73 cfg.
insert(
"UncheckedState", editTypeElement.
attribute(
"unchecked" ) );
79 widgetType =
"ValueRelation";
80 cfg.
insert(
"AllowNull", editTypeElement.
attribute(
"allowNull" ) ==
"true" );
81 cfg.
insert(
"OrderByValue", editTypeElement.
attribute(
"orderByValue" ) ==
"true" );
82 cfg.
insert(
"AllowMulti", editTypeElement.
attribute(
"allowMulti",
"false" ) ==
"true" );
84 if ( editTypeElement.
hasAttribute(
"filterAttributeColumn" ) &&
87 filterExpression =
QString(
"\"%1\"='%2'" )
88 .
arg( editTypeElement.
attribute(
"filterAttributeColumn" ) )
89 .arg( editTypeElement.
attribute(
"filterAttributeValue" ) );
93 filterExpression = editTypeElement.
attribute(
"filterExpression", QString::null );
95 cfg.
insert(
"FilterExpression", filterExpression );
105 widgetType =
"DateTime";
106 cfg.
insert(
"display_format", editTypeElement.
attribute(
"dateFormat" ) );
107 cfg.
insert(
"field_format",
"yyyy-MM-dd" );
113 widgetType =
"Photo";
121 widgetType =
"WebView";
129 widgetType =
"Classification";
135 widgetType =
"FileName";
141 widgetType =
"TextEdit";
142 cfg.
insert(
"IsMultiline",
false );
149 widgetType =
"Hidden";
155 widgetType =
"TextEdit";
156 cfg.
insert(
"IsMultiline",
false );
162 widgetType =
"TextEdit";
163 cfg.
insert(
"IsMultiline",
true );
164 cfg.
insert(
"UseHtml",
false );
170 widgetType =
"Enumeration";
176 widgetType =
"UniqueValues";
177 cfg.
insert(
"Editable",
false );
183 widgetType =
"UniqueValues";
184 cfg.
insert(
"Editable",
true );
190 widgetType =
"UuidGenerator";
196 widgetType =
"Color";
216 if ( editType ==
"Hidden" )
221 if ( editType ==
"ValueMap" )
226 if ( editType ==
"TextEdit" )
228 if ( cfg.
value(
"IsMultiline" ).toBool() )
238 if ( editType ==
"Range" )
240 if ( cfg.
value(
"Style" ).toString() ==
"SliderRange" )
244 else if ( cfg.
value(
"Style" ).toString() ==
"DialRange" )
254 if ( editType ==
"UuidGenerator" )
259 if ( editType ==
"UniqueValues" )
261 if ( cfg.
value(
"Editable" ).toBool() )
272 if ( editType ==
"Classification" )
277 if ( editType ==
"CheckBox" )
282 if ( editType ==
"DateTime" )
287 if ( editType ==
"FileName" )
292 if ( editType ==
"WebView" )
297 if ( editType ==
"Photo" )
302 if ( editType ==
"Color" )
307 if ( editType ==
"Enumeration" )
bool fieldEditable(int idx)
is edit widget editable
QString attribute(const QString &name, const QString &defValue) const
The attribute value should not be changed in the attribute form.
int fieldNameIndex(const QString &fieldName) const
Look up field's index from name - case insensitive TODO: sort out case sensitive (indexFromName()) vs...
QDomNodeList childNodes() const
QDomElement toElement() const
bool hasAttribute(const QString &name) const
The attribute value should not be shown in the attribute form.
int toInt(bool *ok, int base) const
uuid generator - readonly and automatically intialized
static Q_DECL_DEPRECATED const QString convertEditType(QgsVectorLayer::EditType editType, QgsEditorWidgetConfig &cfg, QgsVectorLayer *vl, const QString &name, const QDomElement &editTypeElement=QDomElement())
float toFloat(bool *ok) const
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
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.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QDomNode at(int index) const
const T value(const Key &key) const