From a8c26aa5221687a4160a1593c45b1cfb1a8ac9b6 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 85aaea6e6a0e..fcdbdd705c39 100644 --- a/src/gui/qgsfeaturelistcombobox.cpp +++ b/src/gui/qgsfeaturelistcombobox.cpp @@ -291,9 +291,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 { @@ -312,8 +314,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