From bfbbdac22ab3b95c862240a3aa443461b575b408 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Wed, 18 Sep 2024 11:41:48 +0200 Subject: [PATCH] [forms] Fix default exp stored on rollback Fix #58767 default value stored even when clicking "Cancel" --- src/gui/vector/qgsattributesformproperties.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/vector/qgsattributesformproperties.cpp b/src/gui/vector/qgsattributesformproperties.cpp index e07b0ede9825..8eb641dd3cfc 100644 --- a/src/gui/vector/qgsattributesformproperties.cpp +++ b/src/gui/vector/qgsattributesformproperties.cpp @@ -615,8 +615,13 @@ void QgsAttributesFormProperties::loadAttributeSpecificEditor( QgsAttributesDnDT if ( layout == Qgis::AttributeFormLayout::DragAndDrop ) storeAttributeWidgetEdit(); - storeAttributeTypeDialog(); - storeAttributeContainerEdit(); + + // Do not store while initializing! + if ( !mAvailableWidgetsTree->selectedItems().empty() ) + { + storeAttributeTypeDialog(); + storeAttributeContainerEdit(); + } clearAttributeTypeFrame();