Ejemplo n.º 1
0
 def testFormAnnotationInLayout(self):
     """ test rendering a form annotation"""
     a = QgsFormAnnotation()
     a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
     a.setFrameOffsetFromReferencePointMm(
         QPointF(70 / 3.7795275, 90 / 3.7795275))
     ui = TEST_DATA_DIR + "/test_form.ui"
     a.setDesignerForm(ui)
     self.assertTrue(
         self.renderAnnotationInLayout('form_annotation_in_layout', a))
Ejemplo n.º 2
0
 def testFormAnnotationInLayout(self):
     """ test rendering a form annotation"""
     a = QgsFormAnnotation()
     a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
     a.setFrameOffsetFromReferencePointMm(QPointF(70 / 3.7795275, 90 / 3.7795275))
     ui = TEST_DATA_DIR + "/test_form.ui"
     a.setDesignerForm(ui)
     self.assertTrue(self.renderAnnotationInLayout('form_annotation_in_layout', a))
Ejemplo n.º 3
0
    def testFormAnnotation(self):
        """ test rendering a form annotation"""
        a = QgsFormAnnotation()
        a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
        a.setFrameOffsetFromReferencePointMm(
            QPointF(70 / 3.7795275, 90 / 3.7795275))
        ui = TEST_DATA_DIR + "/test_form.ui"
        a.setDesignerForm(ui)
        im = self.renderAnnotation(a, QPointF(20, 30))
        self.assertTrue(
            self.imageCheck('form_annotation', 'form_annotation', im))

        # check clone
        clone = a.clone()
        im = self.renderAnnotation(clone, QPointF(20, 30))
        self.assertTrue(
            self.imageCheck('form_annotation', 'form_annotation', im))
Ejemplo n.º 4
0
    def testFormAnnotation(self):
        """ test rendering a form annotation"""
        a = QgsFormAnnotation()
        a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
        a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
        a.setFrameOffsetFromReferencePointMm(QPointF(70 / 3.7795275, 90 / 3.7795275))
        ui = TEST_DATA_DIR + "/test_form.ui"
        a.setDesignerForm(ui)
        im = self.renderAnnotation(a, QPointF(20, 30))
        self.assertTrue(self.imageCheck('form_annotation', 'form_annotation', im))

        # check clone
        clone = a.clone()
        im = self.renderAnnotation(clone, QPointF(20, 30))
        self.assertTrue(self.imageCheck('form_annotation', 'form_annotation', im))