From 36236706803ab9b70757eed98aa6e2ec44526596 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Thu, 28 Nov 2024 07:33:11 +0100 Subject: [PATCH] Avoid freeze when opening feature form with many relation widgets --- src/gui/qgsfeaturelistcombobox.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/qgsfeaturelistcombobox.cpp b/src/gui/qgsfeaturelistcombobox.cpp index 286c79bd0076..309e75f2e71c 100644 --- a/src/gui/qgsfeaturelistcombobox.cpp +++ b/src/gui/qgsfeaturelistcombobox.cpp @@ -288,9 +288,11 @@ void QgsFeatureListComboBox::setIdentifierValuesToNull() QgsFeatureRequest QgsFeatureListComboBox::currentFeatureRequest() const { + QgsFeatureRequest request; + request.setRequestMayBeNested( true ); if ( mModel->extraIdentifierValues().isEmpty() ) { - return QgsFeatureRequest().setFilterFids( QgsFeatureIds() ); // NULL: Return a request that's guaranteed to not return anything + request.setFilterFids( QgsFeatureIds() ); // NULL: Return a request that's guaranteed to not return anything } else { @@ -309,8 +311,9 @@ QgsFeatureRequest QgsFeatureListComboBox::currentFeatureRequest() const } } const QString expression = filtersAttrs.join( QLatin1String( " AND " ) ); - return QgsFeatureRequest().setFilterExpression( expression ); + return request.setFilterExpression( expression ); } + return request; } QString QgsFeatureListComboBox::filterExpression() const