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

Class CustomWidget

QListView/CustomWidgetSortItem.py:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class CustomWidget(QWidget):
35
36 def __init__(self, text, *args, **kwargs):
37 super(CustomWidget, self).__init__(*args, **kwargs)
38 layout = QHBoxLayout(self)
39 layout.setContentsMargins(0, 0, 0, 0)
40 layout.addWidget(QLineEdit(text, self))
41 layout.addWidget(QPushButton('x', self))
42
43 def sizeHint(self):
44 # 决定item的高度
45 return QSize(200, 40)
46
47
48class SortFilterProxyModel(QSortFilterProxyModel):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected