diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-13 06:55:37 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-13 06:55:37 +0200 |
commit | b94773c9c838a0b3db1bced0bc8daf5b04aefc29 (patch) | |
tree | 4afe809fa3ac8a83f5eaf98d0b40d4bbf7b5fca4 /src/widgets/widgets/qdatetimeedit.cpp | |
parent | c327fb79e1a50c825a945e97f2c66d07a1c6d225 (diff) | |
parent | 541c9d4d2acd045459c3e75eee80c63b36af9ed0 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
config.tests/unix/compile.test
src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
src/testlib/qtestcase.cpp
src/testlib/qtestcase.qdoc
Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
Diffstat (limited to 'src/widgets/widgets/qdatetimeedit.cpp')
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index f72dc088da..cfba2cc87f 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1674,12 +1674,7 @@ QDateTimeEditPrivate::QDateTimeEditPrivate() cachedDay = -1; currentSectionIndex = FirstSectionIndex; - first.type = FirstSection; - last.type = LastSection; - none.type = NoSection; first.pos = 0; - last.pos = -1; - none.pos = -1; sections = 0; calendarPopup = false; minimum = QDATETIMEEDIT_COMPAT_DATETIME_MIN; @@ -2053,7 +2048,7 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c // doesn't mean that we hit the floor in the other if (steps > 0) { setDigit(v, sectionIndex, min); - if (!(sn.type & (DaySection|DayOfWeekSectionShort|DayOfWeekSectionLong)) && sections & DateSectionMask) { + if (!(sn.type & DaySectionMask) && sections & DateSectionMask) { const int daysInMonth = v.date().daysInMonth(); if (v.date().day() < oldDay && v.date().day() < daysInMonth) { const int adds = qMin(oldDay, daysInMonth); @@ -2068,7 +2063,7 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c } } else { setDigit(v, sectionIndex, max); - if (!(sn.type & (DaySection|DayOfWeekSectionShort|DayOfWeekSectionLong)) && sections & DateSectionMask) { + if (!(sn.type & DaySectionMask) && sections & DateSectionMask) { const int daysInMonth = v.date().daysInMonth(); if (v.date().day() < oldDay && v.date().day() < daysInMonth) { const int adds = qMin(oldDay, daysInMonth); @@ -2086,7 +2081,7 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c setDigit(v, sectionIndex, (steps > 0 ? localmax : localmin)); } } - if (!test && oldDay != v.date().day() && !(sn.type & (DaySection|DayOfWeekSectionShort|DayOfWeekSectionLong))) { + if (!test && oldDay != v.date().day() && !(sn.type & DaySectionMask)) { // this should not happen when called from stepEnabled cachedDay = qMax<int>(oldDay, cachedDay); } @@ -2278,15 +2273,15 @@ QDateTimeEdit::Sections QDateTimeEditPrivate::convertSections(QDateTimeParser::S ret |= QDateTimeEdit::SecondSection; if (s & QDateTimeParser::MinuteSection) ret |= QDateTimeEdit::MinuteSection; - if (s & (QDateTimeParser::Hour24Section|QDateTimeParser::Hour12Section)) + if (s & (QDateTimeParser::HourSectionMask)) ret |= QDateTimeEdit::HourSection; if (s & QDateTimeParser::AmPmSection) ret |= QDateTimeEdit::AmPmSection; - if (s & (QDateTimeParser::DaySection|QDateTimeParser::DayOfWeekSectionShort|QDateTimeParser::DayOfWeekSectionLong)) + if (s & (QDateTimeParser::DaySectionMask)) ret |= QDateTimeEdit::DaySection; if (s & QDateTimeParser::MonthSection) ret |= QDateTimeEdit::MonthSection; - if (s & (QDateTimeParser::YearSection|QDateTimeParser::YearSection2Digits)) + if (s & (QDateTimeParser::YearSectionMask)) ret |= QDateTimeEdit::YearSection; return ret; |