@@ -56,6 +56,7 @@ class GUI_EXPORT QgsAttributeEditorContext
56
56
, mVectorLayerTools ( nullptr )
57
57
, mRelationMode ( Undefined )
58
58
, mFormMode ( Embed )
59
+ , mAllowCustomUi ( true )
59
60
{}
60
61
61
62
QgsAttributeEditorContext ( const QgsAttributeEditorContext& parentContext, FormMode formMode )
@@ -65,6 +66,7 @@ class GUI_EXPORT QgsAttributeEditorContext
65
66
, mDistanceArea ( parentContext.mDistanceArea )
66
67
, mRelationMode ( Undefined )
67
68
, mFormMode ( formMode )
69
+ , mAllowCustomUi ( true )
68
70
{
69
71
Q_ASSERT ( parentContext.vectorLayerTools () );
70
72
}
@@ -77,6 +79,7 @@ class GUI_EXPORT QgsAttributeEditorContext
77
79
, mRelation ( relation )
78
80
, mRelationMode ( relationMode )
79
81
, mFormMode ( widgetMode )
82
+ , mAllowCustomUi ( true )
80
83
{
81
84
Q_ASSERT ( parentContext.vectorLayerTools () );
82
85
}
@@ -111,6 +114,20 @@ class GUI_EXPORT QgsAttributeEditorContext
111
114
*/
112
115
inline void setFormMode ( FormMode mode ) { mFormMode = mode; }
113
116
117
+ /* * Returns true if the attribute editor should permit use of custom UI forms.
118
+ * @see setAllowCustomUi()
119
+ * @note added in QGIS 2.16
120
+ */
121
+ bool allowCustomUi () const { return mAllowCustomUi ; }
122
+
123
+ /* * Sets whether the attribute editor should permit use of custom UI forms.
124
+ * @param allow set to true to allow custom UI forms, or false to disable them and use default generated
125
+ * QGIS forms
126
+ * @see allowCustomUi()
127
+ * @note added in QGIS 2.16
128
+ */
129
+ void setAllowCustomUi ( bool allow ) { mAllowCustomUi = allow; }
130
+
114
131
inline const QgsAttributeEditorContext* parentContext () const { return mParentContext ; }
115
132
116
133
private:
@@ -121,6 +138,7 @@ class GUI_EXPORT QgsAttributeEditorContext
121
138
QgsRelation mRelation ;
122
139
RelationMode mRelationMode ;
123
140
FormMode mFormMode ;
141
+ bool mAllowCustomUi ;
124
142
};
125
143
126
144
#endif // QGSATTRIBUTEEDITORCONTEXT_H
0 commit comments