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

Method updateUi

QtChart/BarStack.py:67–82  ·  view source on GitHub ↗
(self, title, bars)

Source from the content-addressed store, hash-verified

65 layout.addWidget(self.titleLabel)
66
67 def updateUi(self, title, bars):
68 self.titleLabel.setText(title)
69 for bar, value in bars:
70 if bar not in self.Cache:
71 item = ToolTipItem(
72 bar.color(),
73 (bar.label() or "-") + ":" + str(value), self)
74 self.layout().addWidget(item)
75 self.Cache[bar] = item
76 else:
77 self.Cache[bar].setText(
78 (bar.label() or "-") + ":" + str(value))
79 brush = bar.brush()
80 color = brush.color()
81 self.Cache[bar].setVisible(color.alphaF() == 1.0) # 隐藏那些不可用的项
82 self.adjustSize() # 调整大小
83
84
85class GraphicsProxyWidget(QGraphicsProxyWidget):

Callers 1

showMethod · 0.45

Calls 4

addWidgetMethod · 0.80
ToolTipItemClass · 0.70
setTextMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected