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