summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qpoint.cpp8
-rw-r--r--src/corelib/tools/qsize.cpp8
-rw-r--r--src/corelib/tools/qvector.h17
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;
}