Python PyQt4.QtCore 模块,QDate() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用PyQt4.QtCore.QDate()

项目:kisqpy    作者:pkulev    | 项目源码 | 文件源码
def from_datetime(date):
    """Return QDate object from datetime.date."""

    return QDate(date.year, date.month, date.day)
项目:kisqpy    作者:pkulev    | 项目源码 | 文件源码
def to_datetime(qdate):
    """Return datetime.date object from QDate."""

    return date(day=qdate.day(), month=qdate.month(), year=qdate.year())
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def showSelectedDate(self, _date):
        self.date = QtCore.QDate(_date)
        self.lblDate.setText(str(self.date.day()) + "/" + str(self.date.month()) + "/" + str(self.date.year()))
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def onBtnSave(self):
        _rows = self.ui.tableWidget.rowCount()
        for _row in range (_rows):
            _ret = self.ui.tableWidget.item(_row,2).text()
            if _ret == '?':
                QtGui.QMessageBox.information(self, 'TMV3', "you have to set the Version", QtGui.QMessageBox.Ok)
                return
            _cD = self.ui.tableWidget.cellWidget(_row,3)
            _ret = _cD.date()
            if _ret == QtCore.QDate(2000,1,1):
                QtGui.QMessageBox.information(self, 'TMV3', "you have to set the Creation Date", QtGui.QMessageBox.Ok)
                return

        self.saveTLM3()
        return
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def onBtnSave(self):
        _rows = self.ui.tableWidget.rowCount()
        for _row in range (_rows):
            _cb = self.ui.tableWidget.cellWidget(_row,2)
            _ret = str(_cb.currentText())
            if _ret == "":
                QtGui.QMessageBox.information(self, 'TMV3', "you have to set the new Titles", QtGui.QMessageBox.Ok)
                return
            _ret = self.ui.tableWidget.item(_row,3).text()
            if _ret == '?':
                QtGui.QMessageBox.information(self, 'TMV3', "you have to set the Serial Numbers", QtGui.QMessageBox.Ok)
                return
            _cD = self.ui.tableWidget.cellWidget(_row,4)
            _ret = _cD.date()
            if _ret == QtCore.QDate(2000,1,1):
                QtGui.QMessageBox.information(self, 'TMV3', "you have to set the Calibration Dates", QtGui.QMessageBox.Ok)
                return

        try:
            shutil.copy("../Templates/TMV3.TKR3",self.outputFile)
            self.saveTKR3()
        except Exception as _err:
            QtGui.QMessageBox.information(self, 'TMV3', str(_err), QtGui.QMessageBox.Ok)
        return

        self.saveTKR3()
        return