summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qcalendarbackend_p.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-06-22 12:29:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-19 14:55:26 +0000
commit3431104f4571f9ef3185e04f92078e96a3a6aa67 (patch)
treead9eaf1d8d2ed5b5ce76caafbd6769fbbb19e926 /src/corelib/time/qcalendarbackend_p.h
parent61178f3458f11e5159dc01d24d05b1f224073cb4 (diff)
Make QCalendarBackend's ID an opaque type
As Giuseppe pointed out in API change review, an opaque type should be used. Task-number: QTBUG-94407 Change-Id: I862a6f52d284317e1243fd91f45bb0af130d154a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 1c547698ac3ff25e7581f033886318ee98eacc0a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/time/qcalendarbackend_p.h')
-rw-r--r--src/corelib/time/qcalendarbackend_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/time/qcalendarbackend_p.h b/src/corelib/time/qcalendarbackend_p.h
index b011fa0f62..c3f57e7f74 100644
--- a/src/corelib/time/qcalendarbackend_p.h
+++ b/src/corelib/time/qcalendarbackend_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -93,7 +93,7 @@ public:
virtual ~QCalendarBackend();
virtual QString name() const = 0;
QCalendar::System calendarSystem() const;
- size_t calendarId() const { return m_id; }
+ QCalendar::SystemId calendarId() const { return m_id; }
// Date queries:
virtual int daysInMonth(int month, int year = QCalendar::Unspecified) const = 0;
virtual int daysInYear(int year) const;
@@ -143,11 +143,11 @@ protected:
bool registerAlias(const QString &name);
private:
- const size_t m_id = ~size_t(0);
+ const QCalendar::SystemId m_id;
// QCalendar's access to its registry:
static const QCalendarBackend *fromName(QStringView name);
static const QCalendarBackend *fromName(QLatin1String name);
- static const QCalendarBackend *fromId(size_t id);
+ static const QCalendarBackend *fromId(QCalendar::SystemId id);
// QCalendar's access to singletons:
static const QCalendarBackend *fromEnum(QCalendar::System system);
};