diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-06-19 20:53:25 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-06 21:31:14 +0200 |
commit | df853fed66d891077ae2d04ecfa171d7e2cd5202 (patch) | |
tree | bf29d3718eeee1e17d1640841595de0ba8cda4cf /src/widgets/widgets/qdatetimeedit.cpp | |
parent | 3711bf85ae85c9398642ae276cbd90b5bfaa6688 (diff) |
Use qsizetype in QList
The change creates a slight source incompatibility. The main
things to take care of are
* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.
[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.
Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/widgets/qdatetimeedit.cpp')
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index d5ce003067..01f22b2dd6 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1860,7 +1860,7 @@ int QDateTimeEditPrivate::closestSection(int pos, bool forward) const const QString text = displayText(); if (text.size() - pos < separators.last().size() + 1) - return forward ? LastSectionIndex : sectionNodes.size() - 1; + return forward ? LastSectionIndex : int(sectionNodes.size() - 1); updateCache(value, text); for (int i=0; i<sectionNodes.size(); ++i) { @@ -1892,7 +1892,7 @@ int QDateTimeEditPrivate::nextPrevSection(int current, bool forward) const switch (current) { case FirstSectionIndex: return forward ? 0 : FirstSectionIndex; - case LastSectionIndex: return (forward ? LastSectionIndex : sectionNodes.size() - 1); + case LastSectionIndex: return (forward ? LastSectionIndex : int(sectionNodes.size() - 1)); case NoSectionIndex: return FirstSectionIndex; default: break; } |