From d358a7009ba066586fd97ef1ffc89a0e397d7ce7 Mon Sep 17 00:00:00 2001 From: copper Date: Mon, 13 Jun 2022 20:34:59 +0800 Subject: [PATCH] change background --- rscder/utils/project.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rscder/utils/project.py b/rscder/utils/project.py index efb5a28..ca9694d 100644 --- a/rscder/utils/project.py +++ b/rscder/utils/project.py @@ -493,13 +493,14 @@ class ResultPointLayer(BasicLayer): lyr.placement = QgsPalLayerSettings.OverPoint lyr.xOffset = 2 lyr.yOffset = -2 - lyr.textFont = QFont('Times New Roman', 16) + lyr.textFont = QFont('Times New Roman', 100) text_format = QgsTextFormat() - text_format.color = QColor.fromRgb(255,0,0) - text_format.background().color = QColor('#000000') + text_format.setFont(lyr.textFont) + text_format.color = QColor('#000000') + # text_format.background().color = QColor('#000000') text_format.buffer().setEnabled(True) text_format.buffer().setSize(1) - text_format.buffer().setOpacity(0.5) + text_format.buffer().setOpacity(1) lyr.setFormat(text_format) root = QgsRuleBasedLabeling.Rule(QgsPalLayerSettings()) rule = QgsRuleBasedLabeling.Rule(lyr)