(self, *args, **kwargs)
| 26 | class Window(QWidget): |
| 27 | |
| 28 | def __init__(self, *args, **kwargs): |
| 29 | super(Window, self).__init__(*args, **kwargs) |
| 30 | layout = QHBoxLayout(self) |
| 31 | layout.addWidget(CustomPaintWidget(self)) |
| 32 | layout.addWidget(CustomWidget(self)) |
| 33 | # 注意 |
| 34 | wc = CustomWidget(self) |
| 35 | wc.setAttribute(Qt.WA_StyledBackground) # 很重要 |
| 36 | layout.addWidget(wc) |
| 37 | |
| 38 | |
| 39 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected