Skip to content
Permalink
Browse files
Merge pull request #45703 from domi4484/multieditSupportForRelationEd…
…itor

Multiedit support for relation editor
  • Loading branch information
troopa81 committed Nov 23, 2021
2 parents db77eb1 + 555d5d9 commit 6eda6e40d26920ee86492ab250260ac1f4ab27ca
@@ -246,6 +246,15 @@ Forward the signal to the embedded form
virtual void setFeature( const QgsFeature &feature );


void setMultiEditFeatureIds( const QgsFeatureIds &fids );
%Docstring
Set multiple feature to edit simultaneously.

:param fids: Multiple Id of features to edit

.. versionadded:: 3.24
%End

void setVisible( bool visible );
%Docstring
Sets the visibility of the wrapper's widget.
@@ -74,6 +74,15 @@ Returns the nm relation
void setFeature( const QgsFeature &feature, bool update = true );
%Docstring
Sets the ``feature`` being edited and updates the UI unless ``update`` is set to ``False``
%End

void setMultiEditFeatureIds( const QgsFeatureIds &fids );
%Docstring
Set multiple feature to edit simultaneously.

:param fids: Multiple Id of features to edit

.. versionadded:: 3.24
%End

virtual void setEditorContext( const QgsAttributeEditorContext &context );
@@ -156,6 +165,13 @@ Returns the widget configuration
virtual void setConfig( const QVariantMap &config ) = 0;
%Docstring
Defines the widget configuration
%End

bool multiEditModeActive() const;
%Docstring
Returns true if editing multiple features at a time

.. versionadded:: 3.24
%End

public slots:
@@ -177,9 +193,11 @@ Toggles editing state of the widget
Saves the current modifications in the relation
%End

void addFeature( const QgsGeometry &geometry = QgsGeometry() );
QgsFeatureIds addFeature( const QgsGeometry &geometry = QgsGeometry() );
%Docstring
Adds a new feature with given ``geometry``
Adds new features with given ``geometry``

.. versionadded:: 3.24
%End

void deleteFeature( QgsFeatureId fid = QgsFeatureId() );
@@ -34,6 +34,15 @@ Constructor
virtual QString currentFilterExpression() const;


void setMultiEditFeatureIds( const QgsFeatureIds &fids );
%Docstring
Set multiple feature to edit simultaneously.

:param fids: Multiple Id of features to edit

.. versionadded:: 3.24
%End

};

/************************************************************************
@@ -1,5 +1,5 @@
/***************************************************************************
qgsrelationreferenceconfigdlgbase.h
qgsrelationreferenceconfigdlg.h
--------------------------------------
Date : 21.4.2013
Copyright : (C) 2013 Matthias Kuhn
@@ -59,6 +59,12 @@ void QgsRelationWidgetWrapper::setFeature( const QgsFeature &feature )
mWidget->setFeature( feature );
}

void QgsRelationWidgetWrapper::setMultiEditFeatureIds( const QgsFeatureIds &fids )
{
if ( mWidget && mRelation.isValid() )
mWidget->setMultiEditFeatureIds( fids );
}

void QgsRelationWidgetWrapper::setVisible( bool visible )
{
if ( mWidget )
@@ -213,6 +213,13 @@ class GUI_EXPORT QgsRelationWidgetWrapper : public QgsWidgetWrapper
public slots:
void setFeature( const QgsFeature &feature ) override;

/**
* Set multiple feature to edit simultaneously.
* \param fids Multiple Id of features to edit
* \since QGIS 3.24
*/
void setMultiEditFeatureIds( const QgsFeatureIds &fids );

/**
* Sets the visibility of the wrapper's widget.
* \param visible set to TRUE to show widget, FALSE to hide widget
Loading

0 comments on commit 6eda6e4

Please sign in to comment.