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

Class ToolTipItem

QtChart/ToolTip.py:70–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
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)
87
88
89class ToolTipWidget(QWidget):

Callers 1

updateUiMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected