From 2dee00621632ab8acd0b3d59bdba264afe2f32c1 Mon Sep 17 00:00:00 2001 From: Soroush Rabiei Date: Thu, 8 Aug 2019 15:19:18 +0200 Subject: Adapt QCalendarWidget and QDateTimeEdit to support choice of calendar [ChangeLog][QtWidgets][QCalendarWidget] Allow choice of calendar, with Gregorian remaining the default. [ChangeLog][QtWidgets][QDateTimeEdit] Allow choice of calendar, with Gregorian remaining the default. Change-Id: Ia11dd895032393543aee534b177324e643dcfb20 Done-with: Edward Welbourne Reviewed-by: Volker Hilsheimer --- src/widgets/widgets/qdatetimeedit_p.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/widgets/widgets/qdatetimeedit_p.h') diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h index c05e7d9b48..453ac36d15 100644 --- a/src/widgets/widgets/qdatetimeedit_p.h +++ b/src/widgets/widgets/qdatetimeedit_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. @@ -52,6 +52,7 @@ // #include +#include #include "QtWidgets/qcalendarwidget.h" #include "QtWidgets/qspinbox.h" #include "QtWidgets/qtoolbutton.h" @@ -70,7 +71,6 @@ class Q_AUTOTEST_EXPORT QDateTimeEditPrivate : public QAbstractSpinBoxPrivate, p Q_DECLARE_PUBLIC(QDateTimeEdit) public: QDateTimeEditPrivate(); - ~QDateTimeEditPrivate(); void init(const QVariant &var); void readLocaleSettings(); @@ -145,7 +145,8 @@ class QCalendarPopup : public QWidget { Q_OBJECT public: - explicit QCalendarPopup(QWidget *parent = nullptr, QCalendarWidget *cw = nullptr); + explicit QCalendarPopup(QWidget *parent = nullptr, QCalendarWidget *cw = nullptr, + QCalendar ca = QCalendar()); QDate selectedDate() { return verifyCalendarInstance()->selectedDate(); } void setDate(const QDate &date); void setDateRange(const QDate &min, const QDate &max); @@ -174,6 +175,7 @@ private: QPointer calendar; QDate oldDate; bool dateChanged; + QCalendar calendarSystem; }; QT_END_NAMESPACE -- cgit v1.2.3