def __init__(self, id_, name="", quantity=0):
super().__init__()
self.id_ = id_
self.input = QtWidgets.QLineEdit()
self.quantity_input = QtWidgets.QSpinBox()
self.quantity_input.setRange(0, 9999)
self.quantity_input.setValue(quantity)
self.quantity_input.setSuffix(" mL")
self.input.setText(name)
self.button = QtWidgets.QPushButton("Supprimer")
self.button.clicked.connect(self.remove)
self.layout = QtWidgets.QHBoxLayout(self)
self.layout.addWidget(self.input)
self.layout.addWidget(self.quantity_input)
self.layout.addWidget(self.button)
评论列表
文章目录