Push button with text ".." and minimum width
| 188 | |
| 189 | |
| 190 | class PushButtonMinimumWidth(QPushButton): |
| 191 | """ |
| 192 | Push button with text ".." and minimum width |
| 193 | """ |
| 194 | |
| 195 | def __init__(self, *args, **kwargs): |
| 196 | super().__init__(*args, **kwargs) |
| 197 | text = self.text() |
| 198 | font = self.font() |
| 199 | |
| 200 | fm = QFontMetrics(font) |
| 201 | text_width = fm.width(text) + 6 |
| 202 | self.setFixedWidth(text_width) |
| 203 | |
| 204 | |
| 205 | class PushButtonNamed(QPushButton): |
no outgoing calls
no test coverage detected