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

Method handleMarkerClicked

QtChart/BarStack.py:174–201  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

172 self.lineItem.hide()
173
174 def handleMarkerClicked(self):
175 marker = self.sender() # 信号发送者
176 if not marker:
177 return
178 bar = marker.barset()
179 if not bar:
180 return
181 # bar透明度
182 brush = bar.brush()
183 color = brush.color()
184 alpha = 0.0 if color.alphaF() == 1.0 else 1.0
185 color.setAlphaF(alpha)
186 brush.setColor(color)
187 bar.setBrush(brush)
188 # marker
189 brush = marker.labelBrush()
190 color = brush.color()
191 alpha = 0.4 if color.alphaF() == 1.0 else 1.0
192 # 设置label的透明度
193 color.setAlphaF(alpha)
194 brush.setColor(color)
195 marker.setLabelBrush(brush)
196 # 设置marker的透明度
197 brush = marker.brush()
198 color = brush.color()
199 color.setAlphaF(alpha)
200 brush.setColor(color)
201 marker.setBrush(brush)
202
203 def handleMarkerHovered(self, status):
204 # 设置bar的画笔宽度

Callers

nothing calls this directly

Calls 3

setColorMethod · 0.80
setBrushMethod · 0.80
colorMethod · 0.45

Tested by

no test coverage detected