Beispiel #1
0
 def testMargins(self):
     """ test rendering an annotation with margins"""
     a = QgsHtmlAnnotation()
     a.setFrameSize(QSizeF(400, 250))
     a.setHasFixedMapPosition(False)
     a.setContentsMargin(QgsMargins(15, 10, 30, 20))
     html = TEST_DATA_DIR + "/test_html.html"
     a.setSourceFile(html)
     im = self.renderAnnotation(a, QPointF(20, 30))
     self.assertTrue(self.imageCheck('annotation_margins', 'annotation_margins', im))
Beispiel #2
0
 def testMargins(self):
     """ test rendering an annotation with margins"""
     a = QgsHtmlAnnotation()
     a.setFrameSize(QSizeF(400, 250))
     a.setHasFixedMapPosition(False)
     a.setContentsMargin(QgsMargins(15, 10, 30, 20))
     html = TEST_DATA_DIR + "/test_html.html"
     a.setSourceFile(html)
     im = self.renderAnnotation(a, QPointF(20, 30))
     self.assertTrue(self.imageCheck('annotation_margins', 'annotation_margins', im))
Beispiel #3
0
 def testMargins(self):
     """ test rendering an annotation with margins"""
     a = QgsHtmlAnnotation()
     a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
     a.setHasFixedMapPosition(False)
     a.setContentsMargin(QgsMargins(15, 10, 30, 20))
     html = TEST_DATA_DIR + "/test_html.html"
     a.setSourceFile(html)
     im = self.renderAnnotation(a, QPointF(20, 30))
     self.assertTrue(self.imageCheck('annotation_margins', 'annotation_margins', im))
Beispiel #4
0
 def testMargins(self):
     """ test rendering an annotation with margins"""
     a = QgsHtmlAnnotation()
     a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
     a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
     a.setHasFixedMapPosition(False)
     a.setContentsMargin(QgsMargins(15, 10, 30, 20))
     html = TEST_DATA_DIR + "/test_html.html"
     a.setSourceFile(html)
     im = self.renderAnnotation(a, QPointF(20, 30))
     self.assertTrue(self.imageCheck('annotation_margins', 'annotation_margins', im))