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 10, 2017
1 parent 8759e7c commit f18293f
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 @@ -300,6 +300,15 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant &value )
void QgsRelationReferenceWidget::deleteForeignKey()
{
QVariant nullValue = QgsApplication::nullRepresentation();

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

if ( mReadOnlySelector )
{
QString nullText;
Expand Down Expand Up @@ -511,6 +520,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 f18293f

Please sign in to comment.