Skip to content
Permalink
Browse files

Hide relation widgets when in multiedit/search mode

  • Loading branch information
nyalldawson committed Jun 9, 2016
1 parent ec97622 commit 015ee77a7c62434b9d915b8c78d17a821d5e38da
@@ -39,6 +39,12 @@ void QgsRelationWidgetWrapper::setFeature( const QgsFeature& feature )
mWidget->setFeature( feature );
}

void QgsRelationWidgetWrapper::setVisible( bool visible )
{
if ( mWidget )
mWidget->setVisible( visible );
}

void QgsRelationWidgetWrapper::initWidget( QWidget* editor )
{
QgsRelationEditorWidget* w = dynamic_cast<QgsRelationEditorWidget*>( editor );
@@ -38,6 +38,7 @@ class GUI_EXPORT QgsRelationWidgetWrapper : public QgsWidgetWrapper

public slots:
void setFeature( const QgsFeature& feature ) override;
void setVisible( bool visible );

private:
QgsRelation mRelation;
@@ -174,6 +174,12 @@ void QgsAttributeForm::setMode( QgsAttributeForm::Mode mode )
}
}

bool relationWidgetsVisible = ( mMode == QgsAttributeForm::SingleEditMode || mMode == QgsAttributeForm::AddFeatureMode );
Q_FOREACH ( QgsRelationWidgetWrapper* w, findChildren< QgsRelationWidgetWrapper* >() )
{
w->setVisible( relationWidgetsVisible );
}

switch ( mode )
{
case QgsAttributeForm::SingleEditMode:

0 comments on commit 015ee77

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