diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-27 21:36:32 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-27 21:36:32 +0200 |
commit | 1c8451bdbbd6ca909dfc5b96a24be909810522fc (patch) | |
tree | 9cc69a4794e23f7224d75fc2323fc70e294a9454 /src/corelib/tools | |
parent | 7ebec0fa848de299d4cdee06ccc611ee46494fbf (diff) | |
parent | 0635b1a69dd666f5eed4b096895bd80b1a9420ff (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/tools/qdoc/tree.cpp
tests/auto/gui/painting/qcolor/tst_qcolor.cpp
Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qpoint.cpp | 8 | ||||
-rw-r--r-- | src/corelib/tools/qsize.cpp | 8 | ||||
-rw-r--r-- | src/corelib/tools/qvector.h | 17 |
3 files changed, 16 insertions, 17 deletions
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index dc2a2d9739..94a245375b 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -528,12 +528,8 @@ QDebug operator<<(QDebug dbg, const QPointF &p) /*! \fn bool QPointF::isNull() const - Returns \c true if both the x and y coordinates are set to +0.0; - otherwise returns \c false. - - \note Since this function treats +0.0 and -0.0 differently, points - with zero-valued coordinates where either or both values have a - negative sign are not defined to be null points. + Returns \c true if both the x and y coordinates are set to 0.0 (ignoring + the sign); otherwise returns \c false. */ diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp index 19227432f2..24a29f0213 100644 --- a/src/corelib/tools/qsize.cpp +++ b/src/corelib/tools/qsize.cpp @@ -517,12 +517,8 @@ QDebug operator<<(QDebug dbg, const QSize &s) /*! \fn bool QSizeF::isNull() const - Returns \c true if both the width and height are +0.0; otherwise returns - false. - - \note Since this function treats +0.0 and -0.0 differently, sizes with - zero width and height where either or both values have a negative - sign are not defined to be null sizes. + Returns \c true if both the width and height are 0.0 (ignoring the sign); + otherwise returns \c false. \sa isValid(), isEmpty() */ diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 12baecd37c..2eb2dc4550 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -608,16 +608,23 @@ Q_OUTOFLINE_TEMPLATE T QVector<T>::value(int i, const T &defaultValue) const template <typename T> void QVector<T>::append(const T &t) { - const T copy(t); const bool isTooSmall = uint(d->size + 1) > d->alloc; if (!isDetached() || isTooSmall) { + const T copy(t); QArrayData::AllocationOptions opt(isTooSmall ? QArrayData::Grow : QArrayData::Default); reallocData(d->size, isTooSmall ? d->size + 1 : d->alloc, opt); + + if (QTypeInfo<T>::isComplex) + new (d->end()) T(copy); + else + *d->end() = copy; + + } else { + if (QTypeInfo<T>::isComplex) + new (d->end()) T(t); + else + *d->end() = t; } - if (QTypeInfo<T>::isComplex) - new (d->end()) T(copy); - else - *d->end() = copy; ++d->size; } |