Skip to content

Commit bd5846b

Browse files
committed
Only add feature once when python init function is set on attribute form
Fix #10862
1 parent 9648bc7 commit bd5846b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gui/qgsattributeformlegacyinterface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ void QgsAttributeFormLegacyInterface::featureChanged()
4646
QDialogButtonBox* buttonBox = form()->findChild<QDialogButtonBox*>();
4747
if ( buttonBox )
4848
{
49+
// If the init function did not call disconnect, we do it here before reconnecting
50+
// If it did call disconnect, then the call will just do nothing
51+
QObject::disconnect( buttonBox, SIGNAL( accepted() ), form(), SLOT( accept() ) );
4952
QObject::connect( buttonBox, SIGNAL( accepted() ), form(), SLOT( accept() ) );
5053
}
5154

0 commit comments

Comments
 (0)