Document calendar setting of QCalendarWidget and QDateTimeEdit

It seems this was neglected in 5.14, when the methods were added.
The calendar setting is also not a Q_PROPERTY; and hadn't been tested
until recently.

This follows up on commit 2dee006216

Pick-to: 6.7 6.5
Task-number: QTBUG-115200
Change-Id: I9625bf54d05a55a40867847bd58130be90e78271
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
bb10
Edward Welbourne 2024-04-12 10:11:52 +02:00
parent 439b20eb46
commit 33cc653288
2 changed files with 33 additions and 0 deletions

View File

@ -2731,12 +2731,29 @@ bool QCalendarWidget::isGridVisible() const
return d->m_view->showGrid();
}
/*!
\since 5.14
Report the calendar system in use by this widget.
\sa setCalendar()
*/
QCalendar QCalendarWidget::calendar() const
{
Q_D(const QCalendarWidget);
return d->m_model->m_calendar;
}
/*!
\since 5.14
Set \a c as the calendar system to be used by this widget.
The widget can use any supported calendar system.
By default, it uses the Gregorian calendar.
\sa calendar()
*/
void QCalendarWidget::setCalendar(QCalendar c)
{
Q_D(QCalendarWidget);

View File

@ -303,6 +303,12 @@ void QDateTimeEdit::setTime(QTime time)
}
}
/*!
\since 5.14
Report the calendar system in use by this widget.
\sa setCalendar()
*/
QCalendar QDateTimeEdit::calendar() const
{
@ -310,6 +316,16 @@ QCalendar QDateTimeEdit::calendar() const
return d->calendar;
}
/*!
\since 5.14
Set \a calendar as the calendar system to be used by this widget.
The widget can use any supported calendar system.
By default, it uses the Gregorian calendar.
\sa calendar()
*/
void QDateTimeEdit::setCalendar(QCalendar calendar)
{
Q_D(QDateTimeEdit);