Qdateedit component only accepts dates from 1752

Asked

Viewed 28 times

0

Hello, I need to register data with dates 1500 and 1600 but the Qdateedit component only accepts dates from 1752. Can you change the component? Is there any other component that replaces it? I tried to change the property minimumDate but the minimum is this same.

1 answer

0

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

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

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

Of 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.