Skip to content
Permalink
Browse files

Fix #11456 (canvas not refreshed anymore after adding a new feature)

Resorted to a "minimalist" fix - other solutions would potentially break
even more stuff. The handling of non-modal dialogs for add/edit feature
attributes + handling of isModified() should be addressed at some point.
  • Loading branch information
wonder-sk committed Oct 21, 2014
1 parent aa46df2 commit ba8a60f67b402b1367cfe4b41fe968d1af1fa52d
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/gui/qgsattributeform.cpp
@@ -133,6 +133,8 @@ bool QgsAttributeForm::save()

mIsSaving = true;

bool changedLayer = false;

bool success = true;

emit beforeSave( success );
@@ -194,6 +196,7 @@ bool QgsAttributeForm::save()
{
mFeature.setAttributes( updatedFeature.attributes() );
mLayer->endEditCommand();
changedLayer = true;
}
else
mLayer->destroyEditCommand();
@@ -226,6 +229,7 @@ bool QgsAttributeForm::save()
{
mLayer->endEditCommand();
mFeature.setAttributes( dst );
changedLayer = true;
}
else
{
@@ -237,12 +241,13 @@ bool QgsAttributeForm::save()

emit featureSaved( updatedFeature );

// [MD] disabled trigger of repaint as it interferes with other stuff (#11361).
// [MD] Refresh canvas only when absolutely necessary - it interferes with other stuff (#11361).
// This code should be revisited - and the signals should be fired (+ layer repainted)
// only when actually doing any changes. I am unsure if it is actually a good idea
// to call save() whenever some code asks for vector layer's modified status
// (which is the case when attribute table is open)
//mLayer->triggerRepaint();
if ( changedLayer )
mLayer->triggerRepaint();

mIsSaving = false;

0 comments on commit ba8a60f

Please sign in to comment.
You can’t perform that action at this time.