QDateTimeParser: pass QCalendar by value, not by reference
It's trivially copyable. Task-number: QTBUG-122619 Change-Id: I8fd0cdc0ad4cf09f29f1563571224785e7ecebcf Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
98581c54fe
commit
fcf5253ce8
|
|
@ -1012,7 +1012,7 @@ static int yearInCenturyFrom(int y2d, int baseYear)
|
|||
when on valid date is consistent with the data.
|
||||
*/
|
||||
|
||||
static QDate actualDate(QDateTimeParser::Sections known, const QCalendar &calendar, int baseYear,
|
||||
static QDate actualDate(QDateTimeParser::Sections known, QCalendar calendar, int baseYear,
|
||||
int year, int year2digits, int month, int day, int dayofweek)
|
||||
{
|
||||
QDate actual(year, month, day, calendar);
|
||||
|
|
@ -2327,7 +2327,7 @@ bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::S
|
|||
Sets \a cal as the calendar to use. The default is Gregorian.
|
||||
*/
|
||||
|
||||
void QDateTimeParser::setCalendar(const QCalendar &cal)
|
||||
void QDateTimeParser::setCalendar(QCalendar cal)
|
||||
{
|
||||
calendar = cal;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public:
|
|||
FromString,
|
||||
DateTimeEdit
|
||||
};
|
||||
QDateTimeParser(QMetaType::Type t, Context ctx, const QCalendar &cal = QCalendar())
|
||||
QDateTimeParser(QMetaType::Type t, Context ctx, QCalendar cal = QCalendar())
|
||||
: parserType(t), context(ctx), calendar(cal)
|
||||
{
|
||||
defaultLocale = QLocale::system();
|
||||
|
|
@ -153,7 +153,7 @@ public:
|
|||
|
||||
void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
|
||||
virtual QString displayText() const { return m_text; }
|
||||
void setCalendar(const QCalendar &calendar);
|
||||
void setCalendar(QCalendar calendar);
|
||||
|
||||
private:
|
||||
int sectionMaxSize(Section s, int count) const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue