Skip to content

Commit f18293f

Browse files
committedOct 10, 2017
Filter comboboxes are reset when the widget is initialised and foreign key is deleted
1 parent 8759e7c commit f18293f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant &value )
300300
void QgsRelationReferenceWidget::deleteForeignKey()
301301
{
302302
QVariant nullValue = QgsApplication::nullRepresentation();
303+
304+
// deactivate filter comboboxes
305+
if ( mChainFilters && !mFilterComboBoxes.isEmpty() )
306+
{
307+
QComboBox *cb = mFilterComboBoxes.first();
308+
cb->setCurrentIndex( 0 );
309+
disableChainedComboBoxes( cb );
310+
}
311+
303312
if ( mReadOnlySelector )
304313
{
305314
QString nullText;
@@ -511,6 +520,13 @@ void QgsRelationReferenceWidget::init()
511520
mFilterCache[mFilterFields[i]][cf] << nf;
512521
}
513522
}
523+
524+
if ( !mFilterComboBoxes.isEmpty() )
525+
{
526+
QComboBox *cb = mFilterComboBoxes.first();
527+
cb->setCurrentIndex( 0 );
528+
disableChainedComboBoxes( cb );
529+
}
514530
}
515531
}
516532
else

0 commit comments

Comments
 (0)
Please sign in to comment.