date_time_dialog.py 文件源码

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

项目:well-being-diary 作者: SunyataZero 项目源码 文件源码
def __init__(self, i_unix_time_it, i_parent = None):
        super(DateTimeDialog, self).__init__(i_parent)

        vbox = QtWidgets.QVBoxLayout(self)

        self.date_time_edit = QtWidgets.QDateTimeEdit(self)
        self.date_time_edit.setCalendarPopup(True)
        present_qdatetime = QtCore.QDateTime()
        present_qdatetime.setMSecsSinceEpoch(1000 * i_unix_time_it)
        self.date_time_edit.setDateTime(present_qdatetime)
        vbox.addWidget(self.date_time_edit)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        # -accept and reject are "slots" built into Qt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号