Skip to content
Permalink
Browse files

last fixes and sip_include

  • Loading branch information
signedav committed Sep 11, 2018
1 parent b3e4755 commit 533ab61543166008f1c49ba80dce2f39fe19a5c2
@@ -225,7 +225,7 @@ Set ``attributeFormMode`` for the edited form
.. versionadded:: 3.4
%End

QString attributeFormModeString( const Mode &attributeFormMode );
QString attributeFormModeString() const;
%Docstring
Returns given ``attributeFormMode`` as string

@@ -19,6 +19,16 @@ class QgsAttributeForm : QWidget
%End
public:

enum Mode
{
SingleEditMode,
AddFeatureMode,
MultiEditMode,
SearchMode,
AggregateSearchMode,
IdentifyMode
};

enum FilterType
{
ReplaceFilter,
@@ -1,5 +1,4 @@
// Include auto-generated SIP files
%Include auto_generated/qgsattributeeditorcontext.sip
%Include auto_generated/qgsattributeforminterface.sip
%Include auto_generated/qgsdetaileditemdata.sip
%Include auto_generated/qgsexpressionbuilderdialog.sip
@@ -208,6 +207,7 @@
%Include auto_generated/qgsvariableeditorwidget.sip
%Include auto_generated/qgsvscrollarea.sip
%Include auto_generated/qgsfiledownloaderdialog.sip
%Include auto_generated/qgsattributeeditorcontext.sip
%Include auto_generated/raster/qgscolorrampshaderwidget.sip
%Include auto_generated/raster/qgsmultibandcolorrendererwidget.sip
%Include auto_generated/raster/qgspalettedrendererwidget.sip
@@ -87,7 +87,7 @@ void QgsQmlWidgetWrapper::setQmlContext( )

QgsAttributeEditorContext attributecontext = context();
QgsExpressionContext expressionContext = layer()->createExpressionContext();
expressionContext << QgsExpressionContextUtils::formScope( mFeature, attributecontext.attributeFormModeString( attributecontext.attributeFormMode() ) );
expressionContext << QgsExpressionContextUtils::formScope( mFeature, attributecontext.attributeFormModeString() );
expressionContext.setFeature( mFeature );

QmlExpression *qmlExpression = new QmlExpression();
@@ -236,10 +236,10 @@ class GUI_EXPORT QgsAttributeEditorContext
* Returns given \a attributeFormMode as string
* \since QGIS 3.4
*/
QString attributeFormModeString( const Mode &attributeFormMode )
QString attributeFormModeString() const
{
const QMetaEnum metaEnum( QMetaEnum::fromType<Mode>() );
return metaEnum.valueToKey( static_cast<int>( attributeFormMode ) );
return metaEnum.valueToKey( static_cast<int>( mAttributeFormMode ) );
}

private:
@@ -805,7 +805,7 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )

mExpressionContext.setFeature( ft );

mExpressionContext << QgsExpressionContextUtils::formScope( ft, mContext.attributeFormModeString( mMode ) );
mExpressionContext << QgsExpressionContextUtils::formScope( ft, mContext.attributeFormModeString() );

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

mExpressionContext << QgsExpressionContextUtils::formScope( QgsFeature( mFeature ), mContext.attributeFormModeString( mMode ) );
mExpressionContext << QgsExpressionContextUtils::formScope( QgsFeature( mFeature ), mContext.attributeFormModeString() );

const QVector<ContainerInformation *> infos = mContainerVisibilityInformation;

@@ -46,6 +46,18 @@ class GUI_EXPORT QgsAttributeForm : public QWidget

public:

//! Form modes \deprecated Use QgsAttributeEditorContext::Mode instead.
enum Mode
{
SingleEditMode, //!< Single edit mode, for editing a single feature
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
will add a new feature when the form is accepted. */
MultiEditMode, //!< Multi edit mode, for editing fields of multiple features at once
SearchMode, //!< Form values are used for searching/filtering the layer
AggregateSearchMode, //!< Form is in aggregate search mode, show each widget in this mode \since QGIS 3.0
IdentifyMode //!< Identify the feature \since QGIS 3.0
};

//! Filter types
enum FilterType
{

0 comments on commit 533ab61

Please sign in to comment.
You can’t perform that action at this time.