File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -572,7 +572,7 @@ bool QgsAttributeForm::saveMultiEdits()
572
572
573
573
bool QgsAttributeForm::save ()
574
574
{
575
- if ( mIsSaving )
575
+ if ( mIsSaving || ! mDirty )
576
576
return true ;
577
577
578
578
mIsSaving = true ;
@@ -601,16 +601,20 @@ bool QgsAttributeForm::save()
601
601
602
602
mIsSaving = false ;
603
603
mUnsavedMultiEditChanges = false ;
604
+ mDirty = false ;
604
605
605
606
return success;
606
607
}
607
608
608
609
void QgsAttributeForm::resetValues ()
609
610
{
611
+ mValuesInitialized = false ;
610
612
Q_FOREACH ( QgsWidgetWrapper *ww, mWidgets )
611
613
{
612
614
ww->setFeature ( mFeature );
613
615
}
616
+ mValuesInitialized = true ;
617
+ mDirty = false ;
614
618
}
615
619
616
620
void QgsAttributeForm::resetSearch ()
@@ -665,6 +669,9 @@ void QgsAttributeForm::onAttributeChanged( const QVariant &value )
665
669
if ( oldValue == value && oldValue.isNull () == value.isNull () )
666
670
return ;
667
671
672
+ if ( mValuesInitialized )
673
+ mDirty = true ;
674
+
668
675
switch ( mMode )
669
676
{
670
677
case SingleEditMode:
Original file line number Diff line number Diff line change @@ -364,6 +364,8 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
364
364
QList< QgsAttributeFormWidget *> mFormWidgets ;
365
365
QgsExpressionContext mExpressionContext ;
366
366
QMap<const QgsVectorLayerJoinInfo *, QgsFeature> mJoinedFeatures ;
367
+ bool mValuesInitialized = false ;
368
+ bool mDirty = false ;
367
369
368
370
struct ContainerInformation
369
371
{
You can’t perform that action at this time.
0 commit comments