diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-18 13:07:22 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-09-21 11:16:28 +0200 |
commit | 02b4770c3d867bf0b562db63015a7137479db10a (patch) | |
tree | 57157d0101a295fd394bf9acc91dd216fb361264 /src/qml | |
parent | 858c62583ff776edb8c9e539f0331f5d658de2d1 (diff) | |
parent | 345226aa3ecee8642c3bf46e40c981d4a49d958e (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/qml/qml/qqmltypeloader.cpp
Change-Id: I07647700fc86764c95a5ef95c568e700a70fe45f
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc | 3 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 13 | ||||
-rw-r--r-- | src/qml/qml.pro | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 7 | ||||
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 20 |
5 files changed, 34 insertions, 15 deletions
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index de0515e5d0..3692605c18 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -855,7 +855,8 @@ are otherwise unavailable to the object. In particular, they allow objects to access properties or signals that are specifically relevant to the individual object. -A QML type implementation may choose to create an \e {attaching type} with +A QML type implementation may choose to \l {Providing Attached Objects for +Data Annotations}{create an \e {attaching type} in C++} with particular properties and signals. Instances of this type can then be created and \e attached to specific objects at run time, allowing those objects to access the properties and signals of the attaching type. These are accessed by diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index dae4d11767..d02d08f3e6 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -102,19 +102,16 @@ public: Q_ALWAYS_INLINE quint64 rawValue() const { return _val; } Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; } -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN || defined(QV4_USE_64_BIT_VALUE_ENCODING) +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN static inline int valueOffset() { return 0; } static inline int tagOffset() { return 4; } - Q_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; } - Q_ALWAYS_INLINE quint32 value() const { return _val & quint64(~quint32(0)); } - Q_ALWAYS_INLINE quint32 tag() const { return _val >> 32; } -#else // !Q_LITTLE_ENDIAN && !defined(QV4_USE_64_BIT_VALUE_ENCODING) +#else // !Q_LITTLE_ENDIAN static inline int valueOffset() { return 4; } static inline int tagOffset() { return 0; } - Q_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(value) << 32 | tag; } - Q_ALWAYS_INLINE quint32 tag() const { return _val & quint64(~quint32(0)); } - Q_ALWAYS_INLINE quint32 value() const { return _val >> 32; } #endif + Q_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; } + Q_ALWAYS_INLINE quint32 value() const { return _val & quint64(~quint32(0)); } + Q_ALWAYS_INLINE quint32 tag() const { return _val >> 32; } #if defined(V4_BOOTSTRAP) Q_ALWAYS_INLINE Heap::Base *m() const { Q_UNREACHABLE(); return Q_NULLPTR; } diff --git a/src/qml/qml.pro b/src/qml/qml.pro index cc5023f12a..13e00d8812 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -24,9 +24,13 @@ exists("qqml_enable_gcov") { gcc:!intel_icc:greaterThan(QT_GCC_MAJOR_VERSION, 5) { # Our code is bad. Temporary workaround. - QMAKE_CXXFLAGS += -fno-delete-null-pointer-checks + QMAKE_CXXFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse } +# QTBUG-55238, disable new optimizer for MSVC 2015/Update 3. +release:win32-msvc*:equals(QT_CL_MAJOR_VERSION, 19):equals(QT_CL_MINOR_VERSION, 00): \ + greaterThan(QT_CL_PATCH_VERSION, 24212):QMAKE_CXXFLAGS += -d2SSAOptimizer- + QMAKE_DOCS = $$PWD/doc/qtqml.qdocconf # 2415: variable "xx" of static storage duration was declared but never referenced diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 566f5ef767..20bd5d2620 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1965,10 +1965,13 @@ void QQmlTypeLoader::trimCache() QList<TypeCache::Iterator> unneededTypes; for (TypeCache::Iterator iter = m_typeCache.begin(), end = m_typeCache.end(); iter != end; ++iter) { QQmlTypeData *typeData = iter.value(); + + const bool hasError = !typeData->m_compiledData && !typeData->m_errors.isEmpty(); + const bool isNotReferenced = typeData->isComplete() && typeData->m_compiledData + && typeData->m_compiledData->count() == 1; // typeData->m_compiledData may be set early on in the proccess of loading a file, so it's important // to check the general loading status of the typeData before making any other decisions. - if (typeData->isComplete() && typeData->m_compiledData && typeData->count() == 1 - && typeData->m_compiledData->count() == 1) { + if (typeData->count() == 1 && (hasError || isNotReferenced)) { // There are no live objects of this type unneededTypes.append(iter); } diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index d6d4553946..1ca51ea360 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -1313,9 +1313,23 @@ void QQmlDelegateModelPrivate::itemsRemoved( } } else { if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask) { - for (int i = 1; i < m_groupCount; ++i) { - if (remove.inGroup(i)) - incubationTask->index[i] = remove.index[i]; + if (!cacheItem->isObjectReferenced()) { + releaseIncubator(cacheItem->incubationTask); + cacheItem->incubationTask = 0; + if (cacheItem->object) { + QObject *object = cacheItem->object; + cacheItem->destroyObject(); + if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)) + emitDestroyingPackage(package); + else + emitDestroyingItem(object); + } + cacheItem->scriptRef -= 1; + } else { + for (int i = 1; i < m_groupCount; ++i) { + if (remove.inGroup(i)) + incubationTask->index[i] = remove.index[i]; + } } } if (QQmlDelegateModelAttached *attached = cacheItem->attached) { |