[forms] Address review: allow users to copy widget configuration to clipboard and paste it in the very same field (could be useful as a undo operation after testing intermmediate changes)

This commit is contained in:
Germán Carrillo 2025-01-08 16:31:01 +01:00 committed by Loïc Bartoletti
parent d36d904b43
commit 8c01754d6d

View File

@ -2163,11 +2163,6 @@ void QgsAttributesFormProperties::pasteWidgetConfiguration()
if ( docElem.tagName() != QLatin1String( "FormWidgetClipboard" ) )
return;
// We avoid pasting if origin and target fields are the same
const QString sourceFieldName = docElem.attribute( QStringLiteral( "name" ) );
if ( sourceFieldName == fieldName )
return;
// When pasting, the target item has already been selected and
// has triggered attribute type dialog loading. Therefore, we'll
// only overwrite GUI settings instead of destroying and recreating