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

Class CustomWidget

QListView/CustomWidgetItem.py:26–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26class CustomWidget(QWidget):
27
28 def __init__(self, text, *args, **kwargs):
29 super(CustomWidget, self).__init__(*args, **kwargs)
30 layout = QHBoxLayout(self)
31 layout.setContentsMargins(0, 0, 0, 0)
32 layout.addWidget(QLineEdit(text, self))
33 layout.addWidget(QPushButton('x', self))
34
35 def sizeHint(self):
36 # 决定item的高度
37 return QSize(200, 40)
38
39
40class ListView(QListView):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected