File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 23
23
QgsApplication ,
24
24
QgsUnitTypes ,
25
25
QgsCoordinateReferenceSystem ,
26
+ QgsLabelingEngineSettings ,
26
27
QgsVectorLayer ,
27
28
QgsRasterLayer ,
28
29
QgsMapLayer ,
@@ -1033,6 +1034,28 @@ def testCustomLayerOrderFrom3xProject(self):
1033
1034
self .assertEqual (tree .customLayerOrder (), [layer_y , layer_x ])
1034
1035
self .assertEqual (tree .layerOrder (), [layer_y , layer_x ])
1035
1036
1037
+ def testPalPropertiesReadWrite (self ):
1038
+ tmpDir = QTemporaryDir ()
1039
+ tmpFile = "{}/project.qgs" .format (tmpDir .path ())
1040
+
1041
+ s0 = QgsLabelingEngineSettings ()
1042
+ s0 .setNumCandidatePositions (3 , 33 , 333 )
1043
+
1044
+ p0 = QgsProject ()
1045
+ p0 .setFileName (tmpFile )
1046
+ p0 .setLabelingEngineSettings (s0 )
1047
+ p0 .write ()
1048
+
1049
+ p1 = QgsProject ()
1050
+ p1 .read (tmpFile )
1051
+
1052
+ s1 = p1 .labelingEngineSettings ()
1053
+ candidates = s1 .numCandidatePositions ()
1054
+
1055
+ self .assertEqual (candidates [0 ], 3 )
1056
+ self .assertEqual (candidates [1 ], 33 )
1057
+ self .assertEqual (candidates [2 ], 333 )
1058
+
1036
1059
1037
1060
if __name__ == '__main__' :
1038
1061
unittest .main ()
You can’t perform that action at this time.
0 commit comments