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

Method __init__

QtChart/BarStack.py:38–49  ·  view source on GitHub ↗
(self, color, text, parent=None)

Source from the content-addressed store, hash-verified

36class ToolTipItem(QWidget):
37
38 def __init__(self, color, text, parent=None):
39 super(ToolTipItem, self).__init__(parent)
40 layout = QHBoxLayout(self)
41 layout.setContentsMargins(0, 0, 0, 0)
42 clabel = QLabel(self)
43 clabel.setMinimumSize(12, 12)
44 clabel.setMaximumSize(12, 12)
45 clabel.setStyleSheet("border-radius:6px;background: rgba(%s,%s,%s,%s);" % (
46 color.red(), color.green(), color.blue(), color.alpha()))
47 layout.addWidget(clabel)
48 self.textLabel = QLabel(text, self, styleSheet="color:white;")
49 layout.addWidget(self.textLabel)
50
51 def setText(self, text):
52 self.textLabel.setText(text)

Callers

nothing calls this directly

Calls 2

addWidgetMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected