@@ -111,24 +111,24 @@ void TestQgsAttributeForm::testFieldConstraint()
111
111
// build a form for this feature
112
112
QgsAttributeForm form2 ( layer );
113
113
form2.setFeature ( ft );
114
- QSignalSpy spy ( &form2, SIGNAL ( attributeChanged ( QString, QVariant ) ) );
114
+ QSignalSpy spy ( &form2, SIGNAL ( widgetValueChanged ( QString, QVariant, bool ) ) );
115
115
ww = qobject_cast<QgsEditorWidgetWrapper *>( form2.mWidgets [0 ] );
116
116
117
117
// set value to 1
118
118
ww->setValue ( 1 );
119
- QCOMPARE ( spy.count (), 2 );
119
+ QCOMPARE ( spy.count (), 1 );
120
120
QCOMPARE ( constraintsLabel ( &form2, ww )->text (), validLabel );
121
121
122
122
// set value to null
123
123
spy.clear ();
124
124
ww->setValue ( QVariant () );
125
- QCOMPARE ( spy.count (), 2 );
125
+ QCOMPARE ( spy.count (), 1 );
126
126
QCOMPARE ( constraintsLabel ( &form2, ww )->text (), invalidLabel );
127
127
128
128
// set value to 1
129
129
spy.clear ();
130
130
ww->setValue ( 1 );
131
- QCOMPARE ( spy.count (), 2 );
131
+ QCOMPARE ( spy.count (), 1 );
132
132
QCOMPARE ( constraintsLabel ( &form2, ww )->text (), validLabel );
133
133
134
134
// set a soft constraint
@@ -205,11 +205,11 @@ void TestQgsAttributeForm::testFieldMultiConstraints()
205
205
ww1 = qobject_cast<QgsEditorWidgetWrapper *>( form2.mWidgets [1 ] );
206
206
ww2 = qobject_cast<QgsEditorWidgetWrapper *>( form2.mWidgets [2 ] );
207
207
ww3 = qobject_cast<QgsEditorWidgetWrapper *>( form2.mWidgets [3 ] );
208
- QSignalSpy spy2 ( &form2, SIGNAL ( attributeChanged ( QString, QVariant ) ) );
208
+ QSignalSpy spy2 ( &form2, SIGNAL ( widgetValueChanged ( QString, QVariant, bool ) ) );
209
209
210
210
// change value
211
211
ww0->setValue ( 2 ); // update col0
212
- QCOMPARE ( spy2.count (), 2 );
212
+ QCOMPARE ( spy2.count (), 1 );
213
213
214
214
QCOMPARE ( constraintsLabel ( &form2, ww0 )->text (), inv ); // 2 < ( 1 + 2 )
215
215
QCOMPARE ( constraintsLabel ( &form2, ww1 )->text (), QString () );
@@ -219,7 +219,7 @@ void TestQgsAttributeForm::testFieldMultiConstraints()
219
219
// change value
220
220
spy2.clear ();
221
221
ww0->setValue ( 1 ); // update col0
222
- QCOMPARE ( spy2.count (), 2 );
222
+ QCOMPARE ( spy2.count (), 1 );
223
223
224
224
QCOMPARE ( constraintsLabel ( &form2, ww0 )->text (), val ); // 1 < ( 1 + 2 )
225
225
QCOMPARE ( constraintsLabel ( &form2, ww1 )->text (), QString () );
0 commit comments