QDateEdit component only accepts dates from 1752

0

Hello, I need to register data with dates of 1500 and 1600 but the QDateEdit component only accepts dates from 1752. Can you change the component? Is there any other component that will replace this? I already tried to change the minimumDate property but the minimum is this one.

    
asked by anonymous 24.07.2016 / 20:17

1 answer

0

By default the class QDateEdit accepts dates in the range September 14, 1752 through December 31, 7999. However this range can be changed by simply using the setMinimumDate (concst QDate & min) or the setDateRange (const QDate & min, const QDate & max)

For example, with setDateRange it would look something like this:

QDateEdit dtE;
QDate minDate(1500, 1, 1);
QDate maxDate(1600, 12, 31);
dtE.setDateRange(mindDate, maxDate);

From the documentation

  

By default, this property contains a date that refers to September 14,   1752. The minimum date must be at least the first day in year 100, otherwise setMinimumDate () has no effect.

    
25.07.2016 / 20:05