22 QString widgetType =
"TextEdit";
28 widgetType =
"ValueMap";
29 QDomNodeList valueMapNodes = editTypeElement.childNodes();
31 for (
int j = 0; j < valueMapNodes.size(); j++ )
33 QDomElement value = valueMapNodes.at( j ).toElement();
34 cfg.insert( value.attribute(
"key" ), value.attribute(
"value" ) );
42 cfg.insert(
"Style",
"Edit" );
43 cfg.insert(
"Min", editTypeElement.attribute(
"min" ).toFloat() );
44 cfg.insert(
"Max", editTypeElement.attribute(
"max" ).toFloat() );
45 cfg.insert(
"Step", editTypeElement.attribute(
"step" ).toFloat() );
51 widgetType =
"SliderRange";
52 cfg.insert(
"Style",
"Slider" );
53 cfg.insert(
"Min", editTypeElement.attribute(
"min" ).toFloat() );
54 cfg.insert(
"Max", editTypeElement.attribute(
"max" ).toFloat() );
55 cfg.insert(
"Step", editTypeElement.attribute(
"step" ).toFloat() );
61 widgetType =
"DialRange";
62 cfg.insert(
"Style",
"Dial" );
63 cfg.insert(
"Min", editTypeElement.attribute(
"min" ).toFloat() );
64 cfg.insert(
"Max", editTypeElement.attribute(
"max" ).toFloat() );
65 cfg.insert(
"Step", editTypeElement.attribute(
"step" ).toFloat() );
71 widgetType =
"CheckBox";
72 cfg.insert(
"CheckedState", editTypeElement.attribute(
"checked" ) );
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" );
83 QString filterExpression;
84 if ( editTypeElement.hasAttribute(
"filterAttributeColumn" ) &&
85 editTypeElement.hasAttribute(
"filterAttributeValue" ) )
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 );
96 cfg.insert(
"Layer", editTypeElement.attribute(
"layer" ) );
97 cfg.insert(
"Key", editTypeElement.attribute(
"key" ) );
98 cfg.insert(
"Value", editTypeElement.attribute(
"value" ) );
105 widgetType =
"DateTime";
106 cfg.insert(
"display_format", editTypeElement.attribute(
"dateFormat" ) );
107 cfg.insert(
"field_format",
"yyyy-MM-dd" );
113 widgetType =
"Photo";
114 cfg.insert(
"Width", editTypeElement.attribute(
"widgetWidth" ).toInt() );
115 cfg.insert(
"Height", editTypeElement.attribute(
"widgetHeight" ).toInt() );
121 widgetType =
"WebView";
122 cfg.insert(
"Width", editTypeElement.attribute(
"widgetWidth" ).toInt() );
123 cfg.insert(
"Height", editTypeElement.attribute(
"widgetHeight" ).toInt() );
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" )