@@ -925,7 +925,7 @@ void TestProcessingGui::testNumericWrapperDouble()
925
925
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMin.wrappedWidget () )->minimum (), -5.0 );
926
926
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMin.wrappedWidget () )->maximum (), 999999999.0 );
927
927
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMin.wrappedWidget () )->clearValue (), -5.0 );
928
- QCOMPARE ( wrapperMin.parameterValue (), 0.0 );
928
+ QCOMPARE ( wrapperMin.parameterValue (). toDouble () , 0.0 );
929
929
delete w;
930
930
931
931
// with max value
@@ -939,7 +939,7 @@ void TestProcessingGui::testNumericWrapperDouble()
939
939
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMax.wrappedWidget () )->minimum (), -999999999.0 );
940
940
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMax.wrappedWidget () )->maximum (), 5.0 );
941
941
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMax.wrappedWidget () )->clearValue (), 0.0 );
942
- QCOMPARE ( wrapperMax.parameterValue (), 0.0 );
942
+ QCOMPARE ( wrapperMax.parameterValue (). toDouble () , 0.0 );
943
943
delete w;
944
944
945
945
// with min and max value
@@ -954,7 +954,7 @@ void TestProcessingGui::testNumericWrapperDouble()
954
954
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMinMax.wrappedWidget () )->minimum (), -.1 );
955
955
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMinMax.wrappedWidget () )->maximum (), .1 );
956
956
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperMinMax.wrappedWidget () )->clearValue (), -.1 );
957
- QCOMPARE ( wrapperMinMax.parameterValue (), 0.0 );
957
+ QCOMPARE ( wrapperMinMax.parameterValue (). toDouble () , 0.0 );
958
958
delete w;
959
959
960
960
// with default value
@@ -965,7 +965,7 @@ void TestProcessingGui::testNumericWrapperDouble()
965
965
966
966
w = wrapperDefault.createWrappedWidget ( context );
967
967
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperDefault.wrappedWidget () )->clearValue (), 55.0 );
968
- QCOMPARE ( wrapperDefault.parameterValue (), 55.0 );
968
+ QCOMPARE ( wrapperDefault.parameterValue (). toDouble () , 55.0 );
969
969
delete w;
970
970
971
971
// optional, no default
@@ -977,7 +977,7 @@ void TestProcessingGui::testNumericWrapperDouble()
977
977
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperOptional.wrappedWidget () )->clearValue (), -1000000000.0 );
978
978
QVERIFY ( !wrapperOptional.parameterValue ().isValid () );
979
979
wrapperOptional.setParameterValue ( 5 , context );
980
- QCOMPARE ( wrapperOptional.parameterValue (), 5.0 );
980
+ QCOMPARE ( wrapperOptional.parameterValue (). toDouble () , 5.0 );
981
981
wrapperOptional.setParameterValue ( QVariant (), context );
982
982
QVERIFY ( !wrapperOptional.parameterValue ().isValid () );
983
983
wrapperOptional.setParameterValue ( 5 , context );
@@ -990,18 +990,18 @@ void TestProcessingGui::testNumericWrapperDouble()
990
990
991
991
w = wrapperOptionalDefault.createWrappedWidget ( context );
992
992
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperOptionalDefault.wrappedWidget () )->clearValue (), -1000000000.0 );
993
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 3.0 );
993
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toDouble () , 3.0 );
994
994
wrapperOptionalDefault.setParameterValue ( 5 , context );
995
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 5.0 );
995
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toDouble () , 5.0 );
996
996
wrapperOptionalDefault.setParameterValue ( QVariant (), context );
997
997
QCOMPARE ( static_cast < QgsDoubleSpinBox * >( wrapperOptionalDefault.wrappedWidget () )->value (), -1000000000.0 );
998
998
QVERIFY ( !wrapperOptionalDefault.parameterValue ().isValid () );
999
999
wrapperOptionalDefault.setParameterValue ( 5 , context );
1000
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 5.0 );
1000
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toDouble () , 5.0 );
1001
1001
static_cast < QgsDoubleSpinBox * >( wrapperOptionalDefault.wrappedWidget () )->clear ();
1002
1002
QVERIFY ( !wrapperOptionalDefault.parameterValue ().isValid () );
1003
1003
wrapperOptionalDefault.setParameterValue ( 5 , context );
1004
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 5.0 );
1004
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toDouble () , 5.0 );
1005
1005
1006
1006
delete w;
1007
1007
};
@@ -1078,7 +1078,7 @@ void TestProcessingGui::testNumericWrapperInt()
1078
1078
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMin.wrappedWidget () )->minimum (), -5 );
1079
1079
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMin.wrappedWidget () )->maximum (), 999999999 );
1080
1080
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMin.wrappedWidget () )->clearValue (), -5 );
1081
- QCOMPARE ( wrapperMin.parameterValue (), 0 );
1081
+ QCOMPARE ( wrapperMin.parameterValue (). toInt () , 0 );
1082
1082
delete w;
1083
1083
1084
1084
// with max value
@@ -1091,7 +1091,7 @@ void TestProcessingGui::testNumericWrapperInt()
1091
1091
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMax.wrappedWidget () )->minimum (), -999999999 );
1092
1092
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMax.wrappedWidget () )->maximum (), 5 );
1093
1093
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMax.wrappedWidget () )->clearValue (), 0 );
1094
- QCOMPARE ( wrapperMax.parameterValue (), 0 );
1094
+ QCOMPARE ( wrapperMax.parameterValue (). toInt () , 0 );
1095
1095
delete w;
1096
1096
1097
1097
// with min and max value
@@ -1105,7 +1105,7 @@ void TestProcessingGui::testNumericWrapperInt()
1105
1105
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMinMax.wrappedWidget () )->minimum (), -1 );
1106
1106
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMinMax.wrappedWidget () )->maximum (), 1 );
1107
1107
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperMinMax.wrappedWidget () )->clearValue (), -1 );
1108
- QCOMPARE ( wrapperMinMax.parameterValue (), 0 );
1108
+ QCOMPARE ( wrapperMinMax.parameterValue (). toInt () , 0 );
1109
1109
delete w;
1110
1110
1111
1111
// with default value
@@ -1116,7 +1116,7 @@ void TestProcessingGui::testNumericWrapperInt()
1116
1116
1117
1117
w = wrapperDefault.createWrappedWidget ( context );
1118
1118
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperDefault.wrappedWidget () )->clearValue (), 55 );
1119
- QCOMPARE ( wrapperDefault.parameterValue (), 55 );
1119
+ QCOMPARE ( wrapperDefault.parameterValue (). toInt () , 55 );
1120
1120
delete w;
1121
1121
1122
1122
// optional, no default
@@ -1128,7 +1128,7 @@ void TestProcessingGui::testNumericWrapperInt()
1128
1128
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperOptional.wrappedWidget () )->clearValue (), -1000000000 );
1129
1129
QVERIFY ( !wrapperOptional.parameterValue ().isValid () );
1130
1130
wrapperOptional.setParameterValue ( 5 , context );
1131
- QCOMPARE ( wrapperOptional.parameterValue (), 5 );
1131
+ QCOMPARE ( wrapperOptional.parameterValue (). toInt () , 5 );
1132
1132
wrapperOptional.setParameterValue ( QVariant (), context );
1133
1133
QVERIFY ( !wrapperOptional.parameterValue ().isValid () );
1134
1134
wrapperOptional.setParameterValue ( 5 , context );
@@ -1141,18 +1141,18 @@ void TestProcessingGui::testNumericWrapperInt()
1141
1141
1142
1142
w = wrapperOptionalDefault.createWrappedWidget ( context );
1143
1143
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperOptionalDefault.wrappedWidget () )->clearValue (), -1000000000 );
1144
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 3 );
1144
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toInt () , 3 );
1145
1145
wrapperOptionalDefault.setParameterValue ( 5 , context );
1146
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 5 );
1146
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toInt () , 5 );
1147
1147
wrapperOptionalDefault.setParameterValue ( QVariant (), context );
1148
1148
QCOMPARE ( static_cast < QgsSpinBox * >( wrapperOptionalDefault.wrappedWidget () )->value (), -1000000000 );
1149
1149
QVERIFY ( !wrapperOptionalDefault.parameterValue ().isValid () );
1150
1150
wrapperOptionalDefault.setParameterValue ( 5 , context );
1151
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 5 );
1151
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toInt () , 5 );
1152
1152
static_cast < QgsSpinBox * >( wrapperOptionalDefault.wrappedWidget () )->clear ();
1153
1153
QVERIFY ( !wrapperOptionalDefault.parameterValue ().isValid () );
1154
1154
wrapperOptionalDefault.setParameterValue ( 5 , context );
1155
- QCOMPARE ( wrapperOptionalDefault.parameterValue (), 5 );
1155
+ QCOMPARE ( wrapperOptionalDefault.parameterValue (). toInt () , 5 );
1156
1156
1157
1157
delete w;
1158
1158
};
@@ -1273,7 +1273,7 @@ void TestProcessingGui::testDistanceWrapper()
1273
1273
QCOMPARE ( wrapper.parameterValue ().toDouble (), 2000.0 );
1274
1274
1275
1275
wrapper.setUnitParameterValue ( id );
1276
- QCOMPARE ( wrapper.parameterValue ().toDouble (), 2 );
1276
+ QCOMPARE ( wrapper.parameterValue ().toDouble (), 2.0 );
1277
1277
wrapper.setParameterValue ( 5 , context );
1278
1278
QCOMPARE ( wrapper.parameterValue ().toDouble (), 5.0 );
1279
1279
@@ -1307,13 +1307,13 @@ void TestProcessingGui::testDistanceWrapper()
1307
1307
w = wrapperM.createWrappedWidget ( context );
1308
1308
QSignalSpy spy3 ( &wrapperM, &QgsProcessingDistanceWidgetWrapper::widgetValueHasChanged );
1309
1309
wrapperM.setWidgetValue ( 29 , context );
1310
- QCOMPARE ( wrapperM.widgetValue ().toDouble (), 29 );
1310
+ QCOMPARE ( wrapperM.widgetValue ().toDouble (), 29.0 );
1311
1311
QCOMPARE ( spy3.count (), 1 );
1312
- QCOMPARE ( wrapperM.mDoubleSpinBox ->value (), 29 );
1312
+ QCOMPARE ( wrapperM.mDoubleSpinBox ->value (), 29.0 );
1313
1313
wrapperM.setWidgetValue ( -29 , context );
1314
- QCOMPARE ( wrapperM.widgetValue ().toDouble (), -29 );
1314
+ QCOMPARE ( wrapperM.widgetValue ().toDouble (), -29.0 );
1315
1315
QCOMPARE ( spy3.count (), 2 );
1316
- QCOMPARE ( wrapperM.mDoubleSpinBox ->value (), -29 );
1316
+ QCOMPARE ( wrapperM.mDoubleSpinBox ->value (), -29.0 );
1317
1317
1318
1318
// check signal
1319
1319
wrapperM.mDoubleSpinBox ->setValue ( 33 );
0 commit comments