@@ -278,7 +278,7 @@ void TestQgsValueRelationWidgetWrapper::testDrillDownMulti()
278
278
279
279
QCOMPARE ( w_municipality.mTableWidget ->rowCount (), 1 );
280
280
QCOMPARE ( w_municipality.mTableWidget ->item ( 0 , 0 )->text (), QStringLiteral ( " Some Place By The River" ) );
281
- QCOMPARE ( w_municipality.value (), QVariantList ( { 1 } ) );
281
+ QCOMPARE ( w_municipality.value (), QVariant ( QVariantList ( { 1 } ) ) );
282
282
283
283
// Filter by geometry
284
284
cfg_municipality[ QStringLiteral ( " FilterExpression" ) ] = QStringLiteral ( " contains(buffer(@current_geometry, 1 ), $geometry)" );
@@ -312,7 +312,7 @@ void TestQgsValueRelationWidgetWrapper::testDrillDownMulti()
312
312
313
313
// Check with passing a variant list
314
314
w_municipality.setValue ( QVariantList ( {1 , 2 } ) );
315
- QCOMPARE ( w_municipality.value (), QVariantList ( { 2 , 1 } ) );
315
+ QCOMPARE ( w_municipality.value (), QVariant ( QVariantList ( { 2 , 1 } ) ) );
316
316
317
317
// Check values are checked
318
318
f3.setAttribute ( QStringLiteral ( " fk_municipality" ), QStringLiteral ( " {1,2}" ) );
@@ -322,7 +322,7 @@ void TestQgsValueRelationWidgetWrapper::testDrillDownMulti()
322
322
QCOMPARE ( w_municipality.mTableWidget ->item ( 1 , 0 )->text (), QStringLiteral ( " Some Place By The River" ) );
323
323
QCOMPARE ( w_municipality.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Checked );
324
324
QCOMPARE ( w_municipality.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Checked );
325
- QCOMPARE ( w_municipality.value (), QVariantList ( {2 , 1 } ) );
325
+ QCOMPARE ( w_municipality.value (), QVariant ( QVariantList ( {2 , 1 } ) ) );
326
326
327
327
}
328
328
@@ -694,7 +694,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
694
694
695
695
// FEATURE 1
696
696
w_favoriteauthors.setFeature ( vl_json->getFeature ( 1 ) );
697
- QCOMPARE ( w_favoriteauthors.value (), QVariantList () << 1 << 3 );
697
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( { 1 , 3 } ) ) );
698
698
// check if first feature checked correctly (1,3) pk
699
699
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Checked ); // 1
700
700
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Unchecked ); // 2
@@ -709,7 +709,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
709
709
w_favoriteauthors.mTableWidget ->item ( 4 , 0 )->setCheckState ( Qt::Checked );
710
710
711
711
// check if first feature checked correctly (1,2,3,5)
712
- QCOMPARE ( w_favoriteauthors.value (), QVariantList ( {1 , 2 , 3 , 5 } ) );
712
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( {1 , 2 , 3 , 5 } ) ) );
713
713
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Checked );
714
714
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Checked );
715
715
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 2 , 0 )->checkState (), Qt::Checked );
@@ -730,7 +730,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
730
730
731
731
// FEATURE 2
732
732
w_favoriteauthors.setFeature ( vl_json->getFeature ( 2 ) );
733
- QCOMPARE ( w_favoriteauthors.value (), QVariantList ( {2 , 5 } ) );
733
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( {2 , 5 } ) ) );
734
734
// check if second feature checked correctly
735
735
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
736
736
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Checked );
@@ -743,7 +743,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
743
743
// FEATURE 4
744
744
w_favoriteauthors.setFeature ( vl_json->getFeature ( 4 ) );
745
745
// check if first feature checked correctly (NULL)
746
- QCOMPARE ( w_favoriteauthors.value (), QVariantList () );
746
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList () ) );
747
747
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
748
748
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Unchecked );
749
749
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 2 , 0 )->checkState (), Qt::Unchecked );
@@ -755,7 +755,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
755
755
// FEATURE 5
756
756
w_favoriteauthors.setFeature ( vl_json->getFeature ( 5 ) );
757
757
// check if first feature checked correctly (blank)
758
- QCOMPARE ( w_favoriteauthors.value (), QVariantList ( ) );
758
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( ) ) );
759
759
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
760
760
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Unchecked );
761
761
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 2 , 0 )->checkState (), Qt::Unchecked );
@@ -851,7 +851,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
851
851
852
852
// FEATURE 1
853
853
w_favoriteauthors.setFeature ( vl_json->getFeature ( 1 ) );
854
- QCOMPARE ( w_favoriteauthors.value (), QVariantList ( ) << " 1gamma" << " 3johnson\" quote" );
854
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( { " 1gamma" , " 3johnson\" quote" } ) ) );
855
855
// check if first feature checked correctly (1,3) pk
856
856
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Checked ); // 1
857
857
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Unchecked ); // 2
@@ -866,7 +866,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
866
866
w_favoriteauthors.mTableWidget ->item ( 4 , 0 )->setCheckState ( Qt::Checked );
867
867
868
868
// check if first feature checked correctly (1,2,3,5)
869
- QCOMPARE ( w_favoriteauthors.value (), QVariantList () << " 1gamma" << " 2helm,comma" << " 3johnson\" quote" << " 5adams'singlequote" );
869
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( { " 1gamma" , " 2helm,comma" , " 3johnson\" quote" , " 5adams'singlequote" } ) ) );
870
870
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Checked );
871
871
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Checked );
872
872
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 2 , 0 )->checkState (), Qt::Checked );
@@ -887,7 +887,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
887
887
888
888
// FEATURE 2
889
889
w_favoriteauthors.setFeature ( vl_json->getFeature ( 2 ) );
890
- QCOMPARE ( w_favoriteauthors.value (), QVariantList () << " 2helm,comma" << " 5adams'singlequote" );
890
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( { " 2helm,comma" , " 5adams'singlequote" } ) ) );
891
891
// check if second feature checked correctly
892
892
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
893
893
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Checked );
@@ -900,7 +900,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
900
900
// FEATURE 4
901
901
w_favoriteauthors.setFeature ( vl_json->getFeature ( 4 ) );
902
902
// check if first feature checked correctly (NULL)
903
- QCOMPARE ( w_favoriteauthors.value (), QVariantList ( ) );
903
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( ) ) );
904
904
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
905
905
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Unchecked );
906
906
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 2 , 0 )->checkState (), Qt::Unchecked );
@@ -912,7 +912,7 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
912
912
// FEATURE 5
913
913
w_favoriteauthors.setFeature ( vl_json->getFeature ( 5 ) );
914
914
// check if first feature checked correctly (blank)
915
- QCOMPARE ( w_favoriteauthors.value (), QVariantList () );
915
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList () ) );
916
916
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
917
917
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 1 , 0 )->checkState (), Qt::Unchecked );
918
918
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 2 , 0 )->checkState (), Qt::Unchecked );
0 commit comments