Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make QgsAbstractRelationEditorWidget private virtual methods availabl…
…e in bindings (#41159)
  • Loading branch information
3nids committed Jan 25, 2021
1 parent 13ed787 commit 375764d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 9 deletions.
Expand Up @@ -209,6 +209,14 @@ Deletes the features with ``fids``
Unlinks the features with ``fids``
%End


private:
virtual void updateUi();
virtual void setTitle( const QString &title );
virtual void beforeSetRelationFeature( const QgsRelation &newRelation, const QgsFeature &newFeature );
virtual void afterSetRelationFeature();
virtual void beforeSetRelations( const QgsRelation &newRelation, const QgsRelation &newNmRelation );
virtual void afterSetRelations();
};


Expand Down
4 changes: 3 additions & 1 deletion python/gui/auto_generated/qgsrelationeditorwidget.sip.in
Expand Up @@ -24,7 +24,7 @@
class QgsRelationEditorWidget : QgsAbstractRelationEditorWidget
{
%Docstring
The default relation widget in QGIS. Successor of the now deprecated {:py:class:`QgsRelationEditorWidget`}.
The default relation widget in QGIS.

.. versionadded:: 3.18
%End
Expand Down Expand Up @@ -145,6 +145,8 @@ Sets the title of the root groupbox
virtual void parentFormValueChanged( const QString &attribute, const QVariant &newValue );


private:
virtual void updateUi();
};


Expand Down
26 changes: 26 additions & 0 deletions src/gui/qgsabstractrelationeditorwidget.cpp
Expand Up @@ -587,6 +587,32 @@ void QgsAbstractRelationEditorWidget::unlinkFeatures( const QgsFeatureIds &fids
}
}

void QgsAbstractRelationEditorWidget::updateUi()
{}

void QgsAbstractRelationEditorWidget::setTitle( const QString &title )
{
Q_UNUSED( title )
}

void QgsAbstractRelationEditorWidget::beforeSetRelationFeature( const QgsRelation &newRelation, const QgsFeature &newFeature )
{
Q_UNUSED( newRelation )
Q_UNUSED( newFeature )
}

void QgsAbstractRelationEditorWidget::afterSetRelationFeature()
{}

void QgsAbstractRelationEditorWidget::beforeSetRelations( const QgsRelation &newRelation, const QgsRelation &newNmRelation )
{
Q_UNUSED( newRelation )
Q_UNUSED( newNmRelation )
}

void QgsAbstractRelationEditorWidget::afterSetRelations()
{}

void QgsAbstractRelationEditorWidget::duplicateFeature( const QgsFeatureId &fid )
{
duplicateFeatures( QgsFeatureIds() << fid );
Expand Down
13 changes: 7 additions & 6 deletions src/gui/qgsabstractrelationeditorwidget.h
Expand Up @@ -238,13 +238,14 @@ class GUI_EXPORT QgsAbstractRelationEditorWidget : public QWidget
*/
void unlinkFeatures( const QgsFeatureIds &fids );


private:
virtual void updateUi() {};
virtual void setTitle( const QString &title ) { Q_UNUSED( title ); };
virtual void beforeSetRelationFeature( const QgsRelation &newRelation, const QgsFeature &newFeature ) { Q_UNUSED( newRelation ); Q_UNUSED( newFeature ); };
virtual void afterSetRelationFeature() {};
virtual void beforeSetRelations( const QgsRelation &newRelation, const QgsRelation &newNmRelation ) { Q_UNUSED( newRelation ); Q_UNUSED( newNmRelation ); };
virtual void afterSetRelations() {};
virtual void updateUi() SIP_FORCE;
virtual void setTitle( const QString &title ) SIP_FORCE;
virtual void beforeSetRelationFeature( const QgsRelation &newRelation, const QgsFeature &newFeature ) SIP_FORCE;
virtual void afterSetRelationFeature() SIP_FORCE;
virtual void beforeSetRelations( const QgsRelation &newRelation, const QgsRelation &newNmRelation ) SIP_FORCE;
virtual void afterSetRelations() SIP_FORCE;
};


Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsrelationeditorwidget.h
Expand Up @@ -80,7 +80,7 @@ class QgsFilteredSelectionManager : public QgsVectorLayerSelectionManager


/**
* The default relation widget in QGIS. Successor of the now deprecated {\see QgsRelationEditorWidget}.
* The default relation widget in QGIS.
* \ingroup gui
* \class QgsRelationEditorWidget
* \since QGIS 3.18
Expand Down Expand Up @@ -206,7 +206,7 @@ class GUI_EXPORT QgsRelationEditorWidget : public QgsAbstractRelationEditorWidge
void onDigitizingCompleted( const QgsFeature &feature );

private:
void updateUi() override;
virtual void updateUi() override SIP_FORCE;
void initDualView( QgsVectorLayer *layer, const QgsFeatureRequest &request );
void setMapTool( QgsMapTool *mapTool );
void unsetMapTool();
Expand Down

0 comments on commit 375764d

Please sign in to comment.