Skip to content

Commit 533ab61

Browse files
committed
last fixes and sip_include
1 parent b3e4755 commit 533ab61

7 files changed

+29
-7
lines changed

python/gui/auto_generated/qgsattributeeditorcontext.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Set ``attributeFormMode`` for the edited form
225225
.. versionadded:: 3.4
226226
%End
227227

228-
QString attributeFormModeString( const Mode &attributeFormMode );
228+
QString attributeFormModeString() const;
229229
%Docstring
230230
Returns given ``attributeFormMode`` as string
231231

python/gui/auto_generated/qgsattributeform.sip.in

+10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ class QgsAttributeForm : QWidget
1919
%End
2020
public:
2121

22+
enum Mode
23+
{
24+
SingleEditMode,
25+
AddFeatureMode,
26+
MultiEditMode,
27+
SearchMode,
28+
AggregateSearchMode,
29+
IdentifyMode
30+
};
31+
2232
enum FilterType
2333
{
2434
ReplaceFilter,

python/gui/gui_auto.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Include auto-generated SIP files
2-
%Include auto_generated/qgsattributeeditorcontext.sip
32
%Include auto_generated/qgsattributeforminterface.sip
43
%Include auto_generated/qgsdetaileditemdata.sip
54
%Include auto_generated/qgsexpressionbuilderdialog.sip
@@ -208,6 +207,7 @@
208207
%Include auto_generated/qgsvariableeditorwidget.sip
209208
%Include auto_generated/qgsvscrollarea.sip
210209
%Include auto_generated/qgsfiledownloaderdialog.sip
210+
%Include auto_generated/qgsattributeeditorcontext.sip
211211
%Include auto_generated/raster/qgscolorrampshaderwidget.sip
212212
%Include auto_generated/raster/qgsmultibandcolorrendererwidget.sip
213213
%Include auto_generated/raster/qgspalettedrendererwidget.sip

src/gui/editorwidgets/qgsqmlwidgetwrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void QgsQmlWidgetWrapper::setQmlContext( )
8787

8888
QgsAttributeEditorContext attributecontext = context();
8989
QgsExpressionContext expressionContext = layer()->createExpressionContext();
90-
expressionContext << QgsExpressionContextUtils::formScope( mFeature, attributecontext.attributeFormModeString( attributecontext.attributeFormMode() ) );
90+
expressionContext << QgsExpressionContextUtils::formScope( mFeature, attributecontext.attributeFormModeString() );
9191
expressionContext.setFeature( mFeature );
9292

9393
QmlExpression *qmlExpression = new QmlExpression();

src/gui/qgsattributeeditorcontext.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ class GUI_EXPORT QgsAttributeEditorContext
236236
* Returns given \a attributeFormMode as string
237237
* \since QGIS 3.4
238238
*/
239-
QString attributeFormModeString( const Mode &attributeFormMode )
239+
QString attributeFormModeString() const
240240
{
241241
const QMetaEnum metaEnum( QMetaEnum::fromType<Mode>() );
242-
return metaEnum.valueToKey( static_cast<int>( attributeFormMode ) );
242+
return metaEnum.valueToKey( static_cast<int>( mAttributeFormMode ) );
243243
}
244244

245245
private:

src/gui/qgsattributeform.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )
805805

806806
mExpressionContext.setFeature( ft );
807807

808-
mExpressionContext << QgsExpressionContextUtils::formScope( ft, mContext.attributeFormModeString( mMode ) );
808+
mExpressionContext << QgsExpressionContextUtils::formScope( ft, mContext.attributeFormModeString() );
809809

810810
// Recheck visibility for all containers which are controlled by this value
811811
const QVector<ContainerInformation *> infos = mContainerInformationDependency.value( eww->field().name() );
@@ -819,7 +819,7 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )
819819
void QgsAttributeForm::updateContainersVisibility()
820820
{
821821

822-
mExpressionContext << QgsExpressionContextUtils::formScope( QgsFeature( mFeature ), mContext.attributeFormModeString( mMode ) );
822+
mExpressionContext << QgsExpressionContextUtils::formScope( QgsFeature( mFeature ), mContext.attributeFormModeString() );
823823

824824
const QVector<ContainerInformation *> infos = mContainerVisibilityInformation;
825825

src/gui/qgsattributeform.h

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
4646

4747
public:
4848

49+
//! Form modes \deprecated Use QgsAttributeEditorContext::Mode instead.
50+
enum Mode
51+
{
52+
SingleEditMode, //!< Single edit mode, for editing a single feature
53+
AddFeatureMode, /*!< Add feature mode, for setting attributes for a new feature. In this mode the dialog will be editable even with an invalid feature and
54+
will add a new feature when the form is accepted. */
55+
MultiEditMode, //!< Multi edit mode, for editing fields of multiple features at once
56+
SearchMode, //!< Form values are used for searching/filtering the layer
57+
AggregateSearchMode, //!< Form is in aggregate search mode, show each widget in this mode \since QGIS 3.0
58+
IdentifyMode //!< Identify the feature \since QGIS 3.0
59+
};
60+
4961
//! Filter types
5062
enum FilterType
5163
{

0 commit comments

Comments
 (0)