Skip to content

Commit

Permalink
Filter comboboxes are reset when the widget is initialised and foreig…
Browse files Browse the repository at this point in the history
…n key is deleted
  • Loading branch information
pblottiere committed Oct 19, 2017
1 parent fe52c93 commit f7687e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,15 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant& value )
void QgsRelationReferenceWidget::deleteForeignKey()
{
QVariant nullValue = QSettings().value( "qgis/nullValue", "NULL" );

// deactivate filter comboboxes
if ( mChainFilters && !mFilterComboBoxes.isEmpty() )
{
QComboBox *cb = mFilterComboBoxes.first();
cb->setCurrentIndex( 0 );
disableChainedComboBoxes( cb );
}

if ( mReadOnlySelector )
{
QString nullText = "";
Expand Down Expand Up @@ -522,6 +531,13 @@ void QgsRelationReferenceWidget::init()
mFilterCache[mFilterFields[i]][cf] << nf;
}
}

if ( !mFilterComboBoxes.isEmpty() )
{
QComboBox *cb = mFilterComboBoxes.first();
cb->setCurrentIndex( 0 );
disableChainedComboBoxes( cb );
}
}
}
else
Expand Down

0 comments on commit f7687e2

Please sign in to comment.