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

Method __init__

QtChart/ToolTip.py:72–83  ·  view source on GitHub ↗
(self, color, text, parent=None)

Source from the content-addressed store, hash-verified

70class ToolTipItem(QWidget):
71
72 def __init__(self, color, text, parent=None):
73 super(ToolTipItem, self).__init__(parent)
74 layout = QHBoxLayout(self)
75 layout.setContentsMargins(0, 0, 0, 0)
76 clabel = QLabel(self)
77 clabel.setMinimumSize(12, 12)
78 clabel.setMaximumSize(12, 12)
79 clabel.setStyleSheet("border-radius:6px;background: rgba(%s,%s,%s,%s);" % (
80 color.red(), color.green(), color.blue(), color.alpha()))
81 layout.addWidget(clabel)
82 self.textLabel = QLabel(text, self, styleSheet="color:white;")
83 layout.addWidget(self.textLabel)
84
85 def setText(self, text):
86 self.textLabel.setText(text)

Callers

nothing calls this directly

Calls 2

addWidgetMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected