@@ -69,6 +69,7 @@ class CORE_EXPORT QgsAttributeEditorElement : public QObject
69
69
AeTypeInvalid
70
70
};
71
71
72
+
72
73
QgsAttributeEditorElement ( AttributeEditorType type, QString name, QObject *parent = NULL )
73
74
: QObject( parent ), mType ( type ), mName ( name ) {}
74
75
@@ -430,19 +431,19 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
430
431
Classification,
431
432
EditRange,
432
433
SliderRange,
433
- CheckBox, /* added in 1.4 */
434
+ CheckBox, /* * @note added in 1.4 */
434
435
FileName,
435
436
Enumeration,
436
- Immutable, /* The attribute value should not be changed in the attribute form */
437
- Hidden, /* The attribute value should not be shown in the attribute form @added in 1.4 */
438
- TextEdit, /* multiline edit @added in 1.4*/
439
- Calendar, /* calendar widget @added in 1.5 */
440
- DialRange, /* dial range @added in 1.5 */
441
- ValueRelation, /* value map from an table @added in 1.8 */
442
- UuidGenerator, /* uuid generator - readonly and automatically intialized @added in 1.9 */
443
- Photo, /* phote widget @added in 1.9 */
444
- WebView, /* webview widget @added in 1.9 */
445
- Color, /* color @added in 1.9 */
437
+ Immutable, /* * The attribute value should not be changed in the attribute form */
438
+ Hidden, /* * The attribute value should not be shown in the attribute form @note added in 1.4 */
439
+ TextEdit, /* * multiline edit @note added in 1.4*/
440
+ Calendar, /* * calendar widget @note added in 1.5 */
441
+ DialRange, /* * dial range @note added in 1.5 */
442
+ ValueRelation, /* * value map from an table @note added in 1.8 */
443
+ UuidGenerator, /* * uuid generator - readonly and automatically intialized @note added in 1.9 */
444
+ Photo, /* * phote widget @note added in 1.9 */
445
+ WebView, /* * webview widget @note added in 1.9 */
446
+ Color, /* * color @note added in 1.9 */
446
447
};
447
448
448
449
struct RangeData
@@ -1019,6 +1020,13 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
1019
1020
/* *Adds a tab (for the attribute editor form) holding groups and fields
1020
1021
@note added in version 1.9*/
1021
1022
void addAttributeEditorWidget ( QgsAttributeEditorElement* data );
1023
+
1024
+ const QString& editorWidgetV2 ( int fieldIdx );
1025
+
1026
+ const QMap<QString, QVariant>& editorWidgetV2Config ( int fieldIdx );
1027
+
1028
+ QgsEditorWidgetWrapper* editorWidgetWrapper ( int idx, QWidget* editor, const QVariant& value, QWidget* parent );
1029
+
1022
1030
/* *Returns a list of tabs holding groups and fields
1023
1031
@note added in version 1.9*/
1024
1032
QList< QgsAttributeEditorElement* > &attributeEditorElements ();
@@ -1095,6 +1103,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
1095
1103
/* * set the active layout for the attribute editor for this layer (added in 1.9) */
1096
1104
void setEditorLayout ( EditorLayout editorLayout );
1097
1105
1106
+ void setEditorWidgetV2 ( int attrIdx, const QString& widgetType );
1107
+
1108
+ void setEditorWidgetV2Config ( int attrIdx, const QMap<QString, QVariant>& config );
1109
+
1098
1110
/* * set string representing 'true' for a checkbox (added in 1.4) */
1099
1111
void setCheckedState ( int idx, QString checked, QString notChecked );
1100
1112
@@ -1133,6 +1145,22 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
1133
1145
**/
1134
1146
ValueRelationData &valueRelation ( int idx );
1135
1147
1148
+ /* *
1149
+ * Get relations, where the foreign key is on this layer
1150
+ *
1151
+ * @param Only get relations, where idx forms part of the foreign key
1152
+ * @return A list of relations
1153
+ */
1154
+ QList<QgsRelation> referencingRelations ( int idx );
1155
+
1156
+ /* *
1157
+ * Get relations, where the foreign key is on another layer, referencing this layer
1158
+ *
1159
+ * @param Only get relations, where idx forms part of the referenced key
1160
+ * @return A list of relations
1161
+ */
1162
+ QList<QgsRelation> referencedRelations ( int idx );
1163
+
1136
1164
/* *access date format
1137
1165
* @note added in 1.9
1138
1166
*/
@@ -1373,6 +1401,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
1373
1401
void committedAttributeValuesChanges ( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1374
1402
void committedGeometriesChanges ( const QString& layerId, const QgsGeometryMap& changedGeometries );
1375
1403
1404
+ void saveLayerToProject ();
1405
+
1376
1406
/* * Emitted when the font family defined for labeling layer is not found on system
1377
1407
* @note added in 1.9
1378
1408
*/
@@ -1530,6 +1560,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
1530
1560
QMap< QString, QString> mDateFormats ;
1531
1561
QMap< QString, QSize> mWidgetSize ;
1532
1562
1563
+ QMap<int , QString> mEditorWidgetV2Types ;
1564
+ QMap<int , QMap<QString, QVariant> > mEditorWidgetV2Configs ;
1565
+
1533
1566
/* * Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated) */
1534
1567
EditorLayout mEditorLayout ;
1535
1568
0 commit comments