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

Method __init__

QListView/CustomWidgetItem.py:28–33  ·  view source on GitHub ↗
(self, text, *args, **kwargs)

Source from the content-addressed store, hash-verified

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的高度

Callers

nothing calls this directly

Calls 2

addWidgetMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected