diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-12 20:49:36 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-12 20:49:45 +0200 |
commit | b4cdfc4a12d2b9ebc79fe17a2f1aff67bd940d71 (patch) | |
tree | e7841ee2695a3ef180e186d2df971c8fc207d0f9 /src/qml | |
parent | 650b5db06b057abe2db40fb8d56223e17ba8c06a (diff) | |
parent | af002b8df9b084fd7f26e9eead9844aab36bdc4d (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: Ib31008e593442ca5813fb14ae6b02f7ab2577395
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/doc/src/cppclasses/topic.qdoc | 4 | ||||
-rw-r--r-- | src/qml/doc/src/cppintegration/exposecppattributes.qdoc | 2 | ||||
-rw-r--r-- | src/qml/doc/src/qmllanguageref/documents/scope.qdoc | 2 | ||||
-rw-r--r-- | src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4arraydata.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4internalclass.cpp | 12 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4managed_p.h | 16 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 12 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 24 |
9 files changed, 50 insertions, 28 deletions
diff --git a/src/qml/doc/src/cppclasses/topic.qdoc b/src/qml/doc/src/cppclasses/topic.qdoc index ddb29fbb14..133f9bc72c 100644 --- a/src/qml/doc/src/cppclasses/topic.qdoc +++ b/src/qml/doc/src/cppclasses/topic.qdoc @@ -91,7 +91,7 @@ at run-time using a QQmlComponent. An instance of the QQmlComponent class can be created in C++ directly, or via the \l{QtQml::Qt::createComponent()} {Qt.createComponent()} function in imperative QML code. Arbitrary expressions can be calculated in C++ via the QQmlExpression class, and such expressions -can interact directly the QML context. +can interact directly with the QML context. \section2 The QQmlComponent Class @@ -106,7 +106,7 @@ how to use QQmlComponent. The QQmlExpression class provides a way for clients to evaluate JavaScript expressions from C++, using a particular QML evaluation context. This allows -clients to access QML objects by id, for example. The result of evaluation +clients to access QML objects by id, for example. The result of the evaluation is returned as a QVariant, and the conversion rules are defined by the QML engine. diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index f5aea0b01a..ed0d049564 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -71,7 +71,7 @@ type that is supported by the QML engine. By default, the engine supports a number of Qt C++ types and can automatically convert them as appropriately when used from QML. Additionally, C++ classes that are \l{Registering C++ types with the QML type system}{registered} with -the QML type system can be can be used as data types, as can their enums if +the QML type system can be used as data types, as can their enums if appropriately registered. See \l{qtqml-cppintegration-data.html}{Data Type Conversion Between QML and C++} for further information. diff --git a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc index 3e3bbaca98..eaf1747a6d 100644 --- a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc +++ b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc @@ -105,7 +105,7 @@ ListView { \section1 Binding Scope Object -An object which has a \l{Property Binding}{property binding} is known has the +An object which has a \l{Property Binding}{property binding} is known as the binding's \e{scope object}. In the following example, the \l Item object is the binding's scope object. diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index db9eee7714..030eb72b5f 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -191,7 +191,7 @@ which was then imported by the client), then a property of type \section3 Assigning Values to Property Attributes -The value of a property of an object instance may specified in two separate ways: +The value of a property of an object instance may be specified in two separate ways: \list \li a value assignment on initialization \li an imperative value assignment diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index 62ece57c41..03ae23175b 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -46,6 +46,8 @@ using namespace QV4; +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON + const QV4::VTable QV4::ArrayData::static_vtbl = { 0, QV4::ArrayData::IsExecutionContext, @@ -94,6 +96,8 @@ const ArrayVTable SparseArrayData::static_vtbl = SparseArrayData::length }; +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF + Q_STATIC_ASSERT(sizeof(Heap::ArrayData) == sizeof(Heap::SimpleArrayData)); Q_STATIC_ASSERT(sizeof(Heap::ArrayData) == sizeof(Heap::SparseArrayData)); diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp index af359bc0d3..2f69defd5b 100644 --- a/src/qml/jsruntime/qv4internalclass.cpp +++ b/src/qml/jsruntime/qv4internalclass.cpp @@ -146,16 +146,20 @@ static void insertHoleIntoPropertyData(Object *object, int idx) int icSize = object->internalClass()->size; int from = qMax(idx, inlineSize); int to = from + 1; - if (from < icSize) - memmove(object->propertyData(to), object->propertyData(from), icSize - from - 1); + if (from < icSize) { + memmove(object->propertyData(to), object->propertyData(from), + (icSize - from - 1) * sizeof(Value)); + } if (from == idx) return; if (inlineSize < icSize) *object->propertyData(inlineSize) = *object->propertyData(inlineSize - 1); from = idx; to = from + 1; - if (from < inlineSize - 1) - memmove(object->propertyData(to), object->propertyData(from), inlineSize - from - 1); + if (from < inlineSize - 1) { + memmove(object->propertyData(to), object->propertyData(from), + (inlineSize - from - 1) * sizeof(Value)); + } } static void removeFromPropertyData(Object *object, int idx, bool accessor = false) diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 1109760fc0..d73b990470 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -100,6 +100,18 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} #define Q_VTABLE_FUNCTION(classname, func) \ (classname::func == QV4::Managed::func ? 0 : classname::func) +// Q_VTABLE_FUNCTION triggers a bogus tautological-compare warning in GCC6+ +#if defined(Q_CC_GNU) && Q_CC_GNU >= 600 +#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \ + QT_WARNING_PUSH; \ + QT_WARNING_DISABLE_GCC("-Wtautological-compare") + +#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF \ + ;QT_WARNING_POP +#else +#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON +#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF +#endif #define DEFINE_MANAGED_VTABLE_INT(classname, parentVTable) \ { \ @@ -119,7 +131,9 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} } #define DEFINE_MANAGED_VTABLE(classname) \ -const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0) +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \ +const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0) \ +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF struct Q_QML_PRIVATE_EXPORT Managed : Value { diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index fe6b487a83..82f75a49c6 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -130,7 +130,7 @@ struct ObjectVTable void (*advanceIterator)(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes); }; -#define DEFINE_OBJECT_VTABLE(classname) \ +#define DEFINE_OBJECT_VTABLE_BASE(classname) \ const QV4::ObjectVTable classname::static_vtbl = \ { \ DEFINE_MANAGED_VTABLE_INT(classname, (QT_PREPEND_NAMESPACE(QtPrivate)::is_same<classname::SuperClass, Object>::value) ? Q_NULLPTR : &classname::SuperClass::static_vtbl.vTable), \ @@ -150,7 +150,15 @@ const QV4::ObjectVTable classname::static_vtbl = \ advanceIterator \ } - +#define DEFINE_OBJECT_VTABLE(classname) \ +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \ +DEFINE_OBJECT_VTABLE_BASE(classname) \ +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF + +#define DEFINE_OBJECT_TEMPLATE_VTABLE(classname) \ +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \ +template<> DEFINE_OBJECT_VTABLE_BASE(classname) \ +QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF struct Q_QML_EXPORT Object: Managed { V4_OBJECT2(Object, Object) diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index fa2409a85c..f3c1a88465 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -591,29 +591,21 @@ typedef QQmlSequence<QVector<bool> > QQmlBoolVectorList; template<> DEFINE_OBJECT_VTABLE(QQmlBoolVectorList); typedef QQmlSequence<QStringList> QQmlQStringList; -template<> -DEFINE_OBJECT_VTABLE(QQmlQStringList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlQStringList); typedef QQmlSequence<QList<QString> > QQmlStringList; -template<> -DEFINE_OBJECT_VTABLE(QQmlStringList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlStringList); typedef QQmlSequence<QList<int> > QQmlIntList; -template<> -DEFINE_OBJECT_VTABLE(QQmlIntList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlIntList); typedef QQmlSequence<QList<QUrl> > QQmlUrlList; -template<> -DEFINE_OBJECT_VTABLE(QQmlUrlList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlUrlList); typedef QQmlSequence<QModelIndexList> QQmlQModelIndexList; -template<> -DEFINE_OBJECT_VTABLE(QQmlQModelIndexList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlQModelIndexList); typedef QQmlSequence<QItemSelection> QQmlQItemSelectionRangeList; -template<> -DEFINE_OBJECT_VTABLE(QQmlQItemSelectionRangeList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlQItemSelectionRangeList); typedef QQmlSequence<QList<bool> > QQmlBoolList; -template<> -DEFINE_OBJECT_VTABLE(QQmlBoolList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlBoolList); typedef QQmlSequence<QList<qreal> > QQmlRealList; -template<> -DEFINE_OBJECT_VTABLE(QQmlRealList); +DEFINE_OBJECT_TEMPLATE_VTABLE(QQmlRealList); } |