diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-04 16:14:45 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-05-04 16:14:45 +0200 |
commit | 944b6878df86a81f03377625b2be2797c2e13b9b (patch) | |
tree | 80ace12e33f7a4187a0509949cc7bcdd6a02f856 /src/qml | |
parent | 8f7b36f8999f5f906d6a425d6e54c6c86be4c77e (diff) | |
parent | 9bb640625d1e929f8caac34fa0a0fedeef8687ca (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I694ac053b53b669ef5578fd0074de5ce109f7a09
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4globalobject_p.h | 1 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4mathobject.cpp | 19 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 16 | ||||
-rw-r--r-- | src/qml/qml/qqmlvaluetype.cpp | 9 |
4 files changed, 23 insertions, 22 deletions
diff --git a/src/qml/jsruntime/qv4globalobject_p.h b/src/qml/jsruntime/qv4globalobject_p.h index e00a3445da..ea7a3b06ce 100644 --- a/src/qml/jsruntime/qv4globalobject_p.h +++ b/src/qml/jsruntime/qv4globalobject_p.h @@ -71,7 +71,6 @@ struct Q_QML_EXPORT EvalFunction : FunctionObject ReturnedValue evalCall(CallData *callData, bool directCall) const; - using Object::construct; static ReturnedValue call(const Managed *that, CallData *callData); }; diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp index df1c8c6049..5528409b40 100644 --- a/src/qml/jsruntime/qv4mathobject.cpp +++ b/src/qml/jsruntime/qv4mathobject.cpp @@ -86,17 +86,18 @@ Heap::MathObject::MathObject() m->defineDefaultProperty(QStringLiteral("tan"), QV4::MathObject::method_tan, 1); } -/* copies the sign from y to x and returns the result */ -static double copySign(double x, double y) +#ifdef Q_OS_ANDROID +// C++11's std::copysign is missing in the std namespace, so get it from the root namespace (math.h) +static Q_ALWAYS_INLINE double copySign(double x, double y) { - uchar *xch = (uchar *)&x; - uchar *ych = (uchar *)&y; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) - xch[0] = (xch[0] & 0x7f) | (ych[0] & 0x80); - else - xch[7] = (xch[7] & 0x7f) | (ych[7] & 0x80); - return x; + return ::copysign(x, y); +} +#else // Ok, we have a proper C++11 standard library +static Q_ALWAYS_INLINE double copySign(double x, double y) +{ + return std::copysign(x, y); } +#endif ReturnedValue MathObject::method_abs(CallContext *context) { diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 4fb84198d9..b2171dd86b 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -496,6 +496,14 @@ int QQmlPropertyRawData::encodedIndex() const return isValueTypeVirtual()?QQmlPropertyData::encodeValueTypePropertyIndex(coreIndex, valueTypeCoreIndex):coreIndex; } +inline QQmlPropertyData *QQmlPropertyCache::ensureResolved(QQmlPropertyData *p) const +{ + if (p && p->notFullyResolved()) + resolve(p); + + return p; +} + inline QQmlPropertyData *QQmlPropertyCache::property(int index) const { if (index < 0 || index >= (propertyIndexCacheStart + propertyIndexCache.count())) @@ -556,14 +564,6 @@ int QQmlPropertyCache::signalOffset() const return signalHandlerIndexCacheStart; } -inline QQmlPropertyData *QQmlPropertyCache::ensureResolved(QQmlPropertyData *p) const -{ - if (p && p->notFullyResolved()) - resolve(p); - - return p; -} - QQmlMetaObject::QQmlMetaObject() { } diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp index 28bbaf0e92..44fd47244d 100644 --- a/src/qml/qml/qqmlvaluetype.cpp +++ b/src/qml/qml/qqmlvaluetype.cpp @@ -523,7 +523,7 @@ void QQmlEasingValueType::setBezierCurve(const QVariantList &customCurveVariant) QVariantList variantList = customCurveVariant; if ((variantList.count() % 6) == 0) { bool allRealsOk = true; - QList<qreal> reals; + QVector<qreal> reals; const int variantListCount = variantList.count(); reals.reserve(variantListCount); for (int i = 0; i < variantListCount; i++) { @@ -557,9 +557,10 @@ void QQmlEasingValueType::setBezierCurve(const QVariantList &customCurveVariant) QVariantList QQmlEasingValueType::bezierCurve() const { QVariantList rv; - QVector<QPointF> points = v.toCubicSpline(); - for (int ii = 0; ii < points.count(); ++ii) - rv << QVariant(points.at(ii).x()) << QVariant(points.at(ii).y()); + const QVector<QPointF> points = v.toCubicSpline(); + rv.reserve(points.size() * 2); + for (const auto &point : points) + rv << QVariant(point.x()) << QVariant(point.y()); return rv; } |