From 33cc65328819836374eb4823e571789b066003f5 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 12 Apr 2024 10:11:52 +0200 Subject: 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 2dee00621632ab8acd0b3d59bdba264afe2f32c1 Pick-to: 6.7 6.5 Task-number: QTBUG-115200 Change-Id: I9625bf54d05a55a40867847bd58130be90e78271 Reviewed-by: Paul Wicking --- src/widgets/widgets/qcalendarwidget.cpp | 17 +++++++++++++++++ src/widgets/widgets/qdatetimeedit.cpp | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 034127b4f3..0495b20422 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -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); diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 01e52b2fa6..c15d087bc5 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -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); -- cgit v1.2.3