Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # why doesn't setMinimumDate do anything?
- class DateTimeEdit(QDateTimeEdit):
- def __init__(self, parent):
- super(DateTimeEdit, self).__init__(parent)
- self.setCalendarPopup(True)
- self.cw = QCalendarWidget(self)
- self.setCalendarWidget(self.cw)
- self.setMinimumDate(QDate.fromJulianDay(1))
- print self.minimumDateTime()
- print QDate.fromJulianDay(1)
- class MainWindow(QMainWindow):
- def __init__(self, parent=None):
- super(MainWindow, self).__init__(parent)
- self.widget = DateTimeEdit(self)
- self.setCentralWidget(self.widget)
- self.show()
- if __name__ == "__main__":
- app = QApplication(sys.argv)
- form = MainForm()
- form.show()
- sys.exit(app.exec_())
- # output
- PyQt4.QtCore.QDateTime(1752, 9, 14, 0, 0)
- PyQt4.QtCore.QDate(-4713, 1, 2)
Advertisement
Add Comment
Please, Sign In to add comment