MCPcopy Create free account
hub / github.com/PyQt5/PyQt / __setTitle

Method __setTitle

Test/ChartView/ChartView.py:121–139  ·  view source on GitHub ↗

:param title: title json

(self, title=None)

Source from the content-addressed store, hash-verified

119 # return Qt.AlignTop
120
121 def __setTitle(self, title=None):
122 '''
123 :param title: title json
124 '''
125 if not title or not isinstance(title, dict):
126 return
127 # 设置标题
128 self._chart.setTitle(title.get("text", "") or "")
129 # 设置标题颜色
130 self._chart.setTitleBrush(self.__getColor(
131 title.get("color", self._chart.titleBrush()) or self._chart.titleBrush()))
132 # 设置标题字体
133 font = QFont(title.get("font", "") or self._chart.titleFont())
134 pointSize = title.get("pointSize", -1) or -1
135 if pointSize > 0:
136 font.setPointSize(pointSize)
137 font.setWeight(title.get("weight", -1) or -1)
138 font.setItalic(title.get("italic", False) or False)
139 self._chart.setTitleFont(font)
140
141 def __setAnimation(self, animation=None):
142 '''

Callers 1

__analysisMethod · 0.95

Calls 2

__getColorMethod · 0.95
setTitleMethod · 0.45

Tested by

no test coverage detected