Beispiel #1
0
    def setUp(self):
        """Run before each test."""
        super(TestPlacementBase, self).setUp()
        self.removeAllLayers()
        self.configTest('pal_placement', 'sp')
        self._TestImage = ''

        self._Mismatch = 0
        self._ColorTol = 0
        self._Mismatches.clear()
        self._ColorTols.clear()

        # render only rectangles of the placed labels
        engine_settings = QgsLabelingEngineSettings()
        engine_settings.setPlacementVersion(QgsLabelingEngineSettings.PlacementEngineVersion2)
        engine_settings.setFlag(QgsLabelingEngineSettings.DrawLabelRectOnly)
        self._MapSettings.setLabelingEngineSettings(engine_settings)
 def setDefaultEngineSettings(cls):
     """Restore default settings for pal labeling"""
     settings = QgsLabelingEngineSettings()
     settings.setPlacementVersion(
         QgsLabelingEngineSettings.PlacementEngineVersion2)
     cls._MapSettings.setLabelingEngineSettings(settings)