diff options
author | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2016-01-18 18:19:21 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2016-02-02 16:28:48 +0000 |
commit | 72b57a5dfa49b4d4dd3b88cca8cc97e7283dcdf0 (patch) | |
tree | 42638bcd2c57cdba5b27d7ccaacb3c726948736d /src/widgets | |
parent | a965d505a0149007cae2cbfe5d5c530b3986e826 (diff) |
Disintermediate QDateTimeParser::SectionNode operations.
The name, format and maxChange of a Section depend only on the
section, not on the details of the currently parsed text it matches;
so we don't need the parser object's list of all sections to work them
out. Move these methods to the SectionNode and act directly on that
instead of going via the section list.
Make the name take a Section enum instead of an int.
Likewise, make stateName take a State enum instead of an int.
Change-Id: Ie340d042ab95aec517013c4dcc30901d40305c78
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index abee788a46..7ed4564654 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -873,7 +873,7 @@ void QDateTimeEdit::setDisplayFormat(const QString &format) d->displayFormat.clear(); for (int i=d->sectionNodes.size() - 1; i>=0; --i) { d->displayFormat += d->separators.at(i + 1); - d->displayFormat += d->sectionFormat(i); + d->displayFormat += d->sectionNode(i).format(); } d->displayFormat += d->separators.at(0); d->separators = reverse(d->separators); @@ -2214,9 +2214,9 @@ void QDateTimeEditPrivate::_q_editorCursorPositionChanged(int oldpos, int newpos } } - QDTEDEBUG << "currentSectionIndex is set to" << sectionName(sectionType(s)) + QDTEDEBUG << "currentSectionIndex is set to" << sectionNode(s).name() << oldpos << newpos - << "was" << sectionName(sectionType(currentSectionIndex)); + << "was" << sectionNode(currentSectionIndex).name(); currentSectionIndex = s; Q_ASSERT_X(currentSectionIndex < sectionNodes.size(), |