Skip to content

Commit 8414345

Browse files
committed
Doc for editor widget types
1 parent 695e3e2 commit 8414345

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed

src/core/qgsvectorlayer.h

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class CORE_EXPORT QgsAttributeEditorElement : public QObject
6969
AeTypeInvalid
7070
};
7171

72+
7273
QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
7374
: QObject( parent ), mType( type ), mName( name ) {}
7475

@@ -430,19 +431,19 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
430431
Classification,
431432
EditRange,
432433
SliderRange,
433-
CheckBox, /* added in 1.4 */
434+
CheckBox, /** @note added in 1.4 */
434435
FileName,
435436
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 */
446447
};
447448

448449
struct RangeData
@@ -1019,6 +1020,13 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
10191020
/**Adds a tab (for the attribute editor form) holding groups and fields
10201021
@note added in version 1.9*/
10211022
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+
10221030
/**Returns a list of tabs holding groups and fields
10231031
@note added in version 1.9*/
10241032
QList< QgsAttributeEditorElement* > &attributeEditorElements();
@@ -1095,6 +1103,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
10951103
/** set the active layout for the attribute editor for this layer (added in 1.9) */
10961104
void setEditorLayout( EditorLayout editorLayout );
10971105

1106+
void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1107+
1108+
void setEditorWidgetV2Config( int attrIdx, const QMap<QString, QVariant>& config );
1109+
10981110
/** set string representing 'true' for a checkbox (added in 1.4) */
10991111
void setCheckedState( int idx, QString checked, QString notChecked );
11001112

@@ -1133,6 +1145,22 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
11331145
**/
11341146
ValueRelationData &valueRelation( int idx );
11351147

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+
11361164
/**access date format
11371165
* @note added in 1.9
11381166
*/
@@ -1373,6 +1401,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
13731401
void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
13741402
void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
13751403

1404+
void saveLayerToProject();
1405+
13761406
/** Emitted when the font family defined for labeling layer is not found on system
13771407
* @note added in 1.9
13781408
*/
@@ -1530,6 +1560,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
15301560
QMap< QString, QString> mDateFormats;
15311561
QMap< QString, QSize> mWidgetSize;
15321562

1563+
QMap<int, QString> mEditorWidgetV2Types;
1564+
QMap<int, QMap<QString, QVariant> > mEditorWidgetV2Configs;
1565+
15331566
/** Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated) */
15341567
EditorLayout mEditorLayout;
15351568

0 commit comments

Comments
 (0)