41 configElement.
setAttribute(
"FileWidget", config.value(
"FileWidget",
true ).toBool() );
42 configElement.
setAttribute(
"FileWidgetButton", config.value(
"FileWidgetButton",
true ).toBool() );
46 if ( config.contains(
"UseLink" ) )
47 configElement.
setAttribute(
"UseLink", config.value(
"UseLink" ).toBool() );
49 if ( config.contains(
"FullUrl" ) )
50 configElement.
setAttribute(
"FullUrl", config.value(
"FullUrl" ).toBool() );
52 if ( config.contains(
"DefaultRoot" ) )
53 configElement.
setAttribute(
"DefaultRoot", config.value(
"DefaultRoot" ).toString() );
55 if ( config.contains(
"RelativeStorage" ) )
56 configElement.
setAttribute(
"RelativeStorage" , config.value(
"RelativeStorage" ).toString() );
58 if ( config.contains(
"DocumentViewer" ) )
59 configElement.
setAttribute(
"DocumentViewer", config.value(
"DocumentViewer" ).toInt() );
61 if ( config.contains(
"DocumentViewerWidth" ) )
62 configElement.
setAttribute(
"DocumentViewerWidth", config.value(
"DocumentViewerWidth" ).toInt() );
64 if ( config.contains(
"DocumentViewerHeight" ) )
65 configElement.
setAttribute(
"DocumentViewerHeight", config.value(
"DocumentViewerHeight" ).toInt() );
67 if ( config.contains(
"FileWidgetFilter" ) )
68 configElement.
setAttribute(
"FileWidgetFilter", config.value(
"FileWidgetFilter" ).toString() );
70 configElement.
setAttribute(
"StorageMode", config.value(
"StorageMode" ).toString() );
81 cfg.insert(
"FileWidgetButton", configElement.
attribute(
"FileWidgetButton" ) ==
"1" );
84 cfg.insert(
"FileWidget", configElement.
attribute(
"FileWidget" ) ==
"1" );
87 cfg.insert(
"UseLink", configElement.
attribute(
"UseLink" ) ==
"1" );
90 cfg.insert(
"FullUrl", configElement.
attribute(
"FullUrl" ) ==
"1" );
93 cfg.insert(
"DefaultRoot", configElement.
attribute(
"DefaultRoot" ) );
99 cfg.insert(
"RelativeStorage" , configElement.
attribute(
"RelativeStorage" ).
toInt() );
103 cfg.insert(
"DocumentViewer", configElement.
attribute(
"DocumentViewer" ) );
105 if ( configElement.
hasAttribute(
"DocumentViewerWidth" ) )
106 cfg.insert(
"DocumentViewerWidth", configElement.
attribute(
"DocumentViewerWidth" ) );
108 if ( configElement.
hasAttribute(
"DocumentViewerHeight" ) )
109 cfg.insert(
"DocumentViewerHeight", configElement.
attribute(
"DocumentViewerHeight" ) );
112 cfg.insert(
"FileWidgetFilter", configElement.
attribute(
"FileWidgetFilter" ) );
115 cfg.insert(
"StorageMode", configElement.
attribute(
"StorageMode",
"Files" ) );
120 bool QgsExternalResourceWidgetFactory::isFieldSupported(
QgsVectorLayer* vl,
int fieldIdx )
122 if ( vl->
fields().
at( fieldIdx ).
type() == QVariant::String )
QString attribute(const QString &name, const QString &defValue) const
const QgsField & at(int i) const
Get field at particular index (must be in range 0..N-1)
QgsFields fields() const
Returns the list of fields of this layer.
QVariantMap QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
bool hasAttribute(const QString &name) const
void setAttribute(const QString &name, const QString &value)
int toInt(bool *ok, int base) const
Represents a vector layer which manages a vector based data sets.
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.