diff options
Diffstat (limited to 'src/widgets/widgets/qcalendarwidget.cpp')
-rw-r--r-- | src/widgets/widgets/qcalendarwidget.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 8570232d23..0495b20422 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -2200,7 +2200,7 @@ QSize QCalendarWidget::minimumSizeHint() const QStyleOption option; option.initFrom(this); - const int marginH = (style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &option) + 1) * 2; + const int marginH = (style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &option, this) + 1) * 2; if (horizontalHeaderFormat() == QCalendarWidget::NoHorizontalHeader) { rows = 6; @@ -2492,14 +2492,14 @@ void QCalendarWidget::showToday() \snippet code/src_gui_widgets_qcalendarwidget.cpp 1 \endtable - By default, the minimum date is the earliest date that the QDate - class can handle. - When setting a minimum date, the maximumDate and selectedDate properties are adjusted if the selection range becomes invalid. If the provided date is not a valid QDate object, the setMinimumDate() function does nothing. + The default minimum date is November 25, 4714 BCE. + You can restore this default by calling clearMinimumDate() (since Qt 6.6). + \sa setDateRange() */ @@ -2548,14 +2548,14 @@ void QCalendarWidget::clearMinimumDate() \snippet code/src_gui_widgets_qcalendarwidget.cpp 2 \endtable - By default, the maximum date is the last day the QDate class can - handle. - When setting a maximum date, the minimumDate and selectedDate properties are adjusted if the selection range becomes invalid. If the provided date is not a valid QDate object, the setMaximumDate() function does nothing. + The default maximum date is December 31, 9999 CE. + You can restore this default by calling clearMaximumDate() (since Qt 6.6). + \sa setDateRange() */ @@ -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); @@ -2873,7 +2890,7 @@ QMap<QDate, QTextCharFormat> QCalendarWidget::dateTextFormat() const } /*! - Returns a QTextCharFormat for \a date. The char format can be be + Returns a QTextCharFormat for \a date. The char format can be empty if the date is not renderd specially. */ QTextCharFormat QCalendarWidget::dateTextFormat(QDate date) const @@ -3099,6 +3116,7 @@ bool QCalendarWidget::event(QEvent *event) case QEvent::StyleChange: d->cachedSizeHint = QSize(); d->m_view->updateGeometry(); + break; default: break; } |