orderform.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:examples 作者: pyqt 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号