MCPcopy Index your code
hub / github.com/PyQt5/PyQt / handleMarkerClicked

Method handleMarkerClicked

QtChart/LineStack.py:179–206  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

177 self.lineItem.hide()
178
179 def handleMarkerClicked(self):
180 marker = self.sender() # 信号发送者
181 if not marker:
182 return
183 visible = not marker.series().isVisible()
184 # # 隐藏或显示series
185 marker.series().setVisible(visible)
186 marker.setVisible(True) # 要保证marker一直显示
187 # 透明度
188 alpha = 1.0 if visible else 0.4
189 # 设置label的透明度
190 brush = marker.labelBrush()
191 color = brush.color()
192 color.setAlphaF(alpha)
193 brush.setColor(color)
194 marker.setLabelBrush(brush)
195 # 设置marker的透明度
196 brush = marker.brush()
197 color = brush.color()
198 color.setAlphaF(alpha)
199 brush.setColor(color)
200 marker.setBrush(brush)
201 # 设置画笔透明度
202 pen = marker.pen()
203 color = pen.color()
204 color.setAlphaF(alpha)
205 pen.setColor(color)
206 marker.setPen(pen)
207
208 def handleMarkerHovered(self, status):
209 # 设置series的画笔宽度

Callers

nothing calls this directly

Calls 4

setColorMethod · 0.80
setBrushMethod · 0.80
setPenMethod · 0.80
colorMethod · 0.45

Tested by

no test coverage detected