QCalendar: replace two overloads with one QAnyStringView function
The backend was already ported, so this is just about applying QT_REMOVED_SINCE and updating the docs. Change-Id: I2c78908deb9cdb3cee19ce8bc148ab3117c1ad9a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
9bfc8f348d
commit
1ae5b3628d
@ -145,6 +145,14 @@ int QOperatingSystemVersion::compare(const QOperatingSystemVersion &v1,
|
|||||||
|
|
||||||
#if QT_REMOVED_SINCE(6, 4)
|
#if QT_REMOVED_SINCE(6, 4)
|
||||||
|
|
||||||
|
#include "qcalendar.h"
|
||||||
|
|
||||||
|
QCalendar::QCalendar(QStringView name)
|
||||||
|
: QCalendar(QAnyStringView{name}) {}
|
||||||
|
|
||||||
|
QCalendar::QCalendar(QLatin1String name)
|
||||||
|
: QCalendar(QAnyStringView{name}) {}
|
||||||
|
|
||||||
#include "qversionnumber.h"
|
#include "qversionnumber.h"
|
||||||
|
|
||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
|
@ -1169,8 +1169,7 @@ const QCalendarBackend *QCalendarBackend::gregorian()
|
|||||||
/*!
|
/*!
|
||||||
\fn QCalendar::QCalendar()
|
\fn QCalendar::QCalendar()
|
||||||
\fn QCalendar::QCalendar(QCalendar::System system)
|
\fn QCalendar::QCalendar(QCalendar::System system)
|
||||||
\fn QCalendar::QCalendar(QLatin1String name)
|
\fn QCalendar::QCalendar(QAnyStringView name)
|
||||||
\fn QCalendar::QCalendar(QStringView name)
|
|
||||||
|
|
||||||
Constructs a calendar object.
|
Constructs a calendar object.
|
||||||
|
|
||||||
@ -1180,6 +1179,9 @@ const QCalendarBackend *QCalendarBackend::gregorian()
|
|||||||
calendar being constructed by other means first. With no argument, the
|
calendar being constructed by other means first. With no argument, the
|
||||||
default constructor returns the Gregorian calendar.
|
default constructor returns the Gregorian calendar.
|
||||||
|
|
||||||
|
\note In Qt versions before 6.4, the constructor by \a name accepted only
|
||||||
|
QStringView and QLatin1String, not QAnyStringView.
|
||||||
|
|
||||||
\sa QCalendar, System, isValid()
|
\sa QCalendar, System, isValid()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1213,13 +1215,7 @@ QCalendar::QCalendar(QCalendar::SystemId id)
|
|||||||
Q_ASSERT(!d_ptr || d_ptr->calendarId().index() == id.index());
|
Q_ASSERT(!d_ptr || d_ptr->calendarId().index() == id.index());
|
||||||
}
|
}
|
||||||
|
|
||||||
QCalendar::QCalendar(QLatin1String name)
|
QCalendar::QCalendar(QAnyStringView name)
|
||||||
: d_ptr(QCalendarBackend::fromName(name))
|
|
||||||
{
|
|
||||||
Q_ASSERT(!d_ptr || d_ptr->calendarId().isValid());
|
|
||||||
}
|
|
||||||
|
|
||||||
QCalendar::QCalendar(QStringView name)
|
|
||||||
: d_ptr(QCalendarBackend::fromName(name))
|
: d_ptr(QCalendarBackend::fromName(name))
|
||||||
{
|
{
|
||||||
Q_ASSERT(!d_ptr || d_ptr->calendarId().isValid());
|
Q_ASSERT(!d_ptr || d_ptr->calendarId().isValid());
|
||||||
|
@ -146,10 +146,11 @@ public:
|
|||||||
|
|
||||||
explicit QCalendar(); // Gregorian, optimised
|
explicit QCalendar(); // Gregorian, optimised
|
||||||
explicit QCalendar(System system);
|
explicit QCalendar(System system);
|
||||||
// ### Qt 7: remove
|
#if QT_REMOVED_SINCE(6, 4)
|
||||||
explicit QCalendar(QLatin1String name);
|
explicit QCalendar(QLatin1String name);
|
||||||
// ### Qt 7: use QAnyStringView
|
|
||||||
explicit QCalendar(QStringView name);
|
explicit QCalendar(QStringView name);
|
||||||
|
#endif
|
||||||
|
explicit QCalendar(QAnyStringView name);
|
||||||
explicit QCalendar(SystemId id);
|
explicit QCalendar(SystemId id);
|
||||||
|
|
||||||
// QCalendar is a trivially copyable value type.
|
// QCalendar is a trivially copyable value type.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user