def __init__(self, title, parent):
super(DetailsDialog, self).__init__(parent)
self.items = ("T-shirt", "Badge", "Reference book", "Coffee cup")
nameLabel = QLabel("Name:")
addressLabel = QLabel("Address:")
addressLabel.setAlignment(Qt.AlignLeft | Qt.AlignTop)
self.nameEdit = QLineEdit()
self.addressEdit = QTextEdit()
self.offersCheckBox = QCheckBox(
"Send information about products and special offers:")
self.setupItemsTable()
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
buttonBox.accepted.connect(self.verify)
buttonBox.rejected.connect(self.reject)
mainLayout = QGridLayout()
mainLayout.addWidget(nameLabel, 0, 0)
mainLayout.addWidget(self.nameEdit, 0, 1)
mainLayout.addWidget(addressLabel, 1, 0)
mainLayout.addWidget(self.addressEdit, 1, 1)
mainLayout.addWidget(self.itemsTable, 0, 2, 2, 1)
mainLayout.addWidget(self.offersCheckBox, 2, 1, 1, 2)
mainLayout.addWidget(buttonBox, 3, 0, 1, 3)
self.setLayout(mainLayout)
self.setWindowTitle(title)
评论列表
文章目录