diff options
Diffstat (limited to 'src/qml/util')
-rw-r--r-- | src/qml/util/qqmladaptormodel.cpp | 23 | ||||
-rw-r--r-- | src/qml/util/qqmladaptormodel_p.h | 11 | ||||
-rw-r--r-- | src/qml/util/qqmllistaccessor_p.h | 11 | ||||
-rw-r--r-- | src/qml/util/qqmllistcompositor_p.h | 12 | ||||
-rw-r--r-- | src/qml/util/qqmlpropertymap.cpp | 3 |
5 files changed, 43 insertions, 17 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index 356970eef0..c61144dd8f 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -38,7 +38,7 @@ #include <private/qqmlproperty_p.h> #include <private/qv8engine_p.h> -#include <private/qv4value_inl_p.h> +#include <private/qv4value_p.h> #include <private/qv4functionobject_p.h> QT_BEGIN_NAMESPACE @@ -159,7 +159,9 @@ public: signalIndexes.append(propertyId + signalOffset); } if (roles.isEmpty()) { - for (int propertyId = 0; propertyId < propertyRoles.count(); ++propertyId) + const int propertyRolesCount = propertyRoles.count(); + signalIndexes.reserve(propertyRolesCount); + for (int propertyId = 0; propertyId < propertyRolesCount; ++propertyId) signalIndexes.append(propertyId + signalOffset); } @@ -219,9 +221,9 @@ public: const QByteArray &propertyName = it.key(); QV4::ScopedString name(scope, v4->newString(QString::fromUtf8(propertyName))); - QV4::ScopedContext global(scope, v4->rootContext()); - QV4::ScopedFunctionObject g(scope, v4->memoryManager->alloc<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::get_property)); - QV4::ScopedFunctionObject s(scope, v4->memoryManager->alloc<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::set_property)); + QV4::ExecutionContext *global = v4->rootContext(); + QV4::ScopedFunctionObject g(scope, v4->memoryManager->allocObject<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::get_property)); + QV4::ScopedFunctionObject s(scope, v4->memoryManager->allocObject<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::set_property)); p->setGetter(g); p->setSetter(s); proto->insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); @@ -426,7 +428,7 @@ public: } QV4::Scope scope(v4); QV4::ScopedObject proto(scope, type->prototype.value()); - QV4::ScopedObject o(scope, proto->engine()->memoryManager->alloc<QQmlDelegateModelItemObject>(proto->engine(), this)); + QV4::ScopedObject o(scope, proto->engine()->memoryManager->allocObject<QQmlDelegateModelItemObject>(this)); o->setPrototype(proto); ++scriptRef; return o.asReturnedValue(); @@ -545,7 +547,7 @@ public: metaObject = builder.toMetaObject(); *static_cast<QMetaObject *>(this) = *metaObject; - propertyCache = new QQmlPropertyCache(engine, metaObject); + propertyCache = new QQmlPropertyCache(QV8Engine::getV4(engine), metaObject); } }; @@ -604,7 +606,7 @@ public: { QQmlAdaptorModelEngineData *data = engineData(v4); QV4::Scope scope(v4); - QV4::ScopedObject o(scope, v4->memoryManager->alloc<QQmlDelegateModelItemObject>(v4, this)); + QV4::ScopedObject o(scope, v4->memoryManager->allocObject<QQmlDelegateModelItemObject>(this)); QV4::ScopedObject p(scope, data->listItemProto.value()); o->setPrototype(p); ++scriptRef; @@ -786,8 +788,11 @@ public: m_type->release(); } - int metaCall(QMetaObject::Call call, int id, void **arguments) + int metaCall(QObject *o, QMetaObject::Call call, int id, void **arguments) { + Q_ASSERT(o == m_data); + Q_UNUSED(o); + static const int objectPropertyOffset = QObject::staticMetaObject.propertyCount(); if (id >= m_type->propertyOffset && (call == QMetaObject::ReadProperty diff --git a/src/qml/util/qqmladaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h index b0f211a0f2..9da04462aa 100644 --- a/src/qml/util/qqmladaptormodel_p.h +++ b/src/qml/util/qqmladaptormodel_p.h @@ -34,6 +34,17 @@ #ifndef QQMLADAPTORMODEL_P_H #define QQMLADAPTORMODEL_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qabstractitemmodel.h> #include "private/qqmllistaccessor_p.h" diff --git a/src/qml/util/qqmllistaccessor_p.h b/src/qml/util/qqmllistaccessor_p.h index cf0ec52be4..1d9069118a 100644 --- a/src/qml/util/qqmllistaccessor_p.h +++ b/src/qml/util/qqmllistaccessor_p.h @@ -34,6 +34,17 @@ #ifndef QQMLLISTACCESSOR_H #define QQMLLISTACCESSOR_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QVariant> QT_BEGIN_NAMESPACE diff --git a/src/qml/util/qqmllistcompositor_p.h b/src/qml/util/qqmllistcompositor_p.h index 8e10cb1546..2ddbc5d5a1 100644 --- a/src/qml/util/qqmllistcompositor_p.h +++ b/src/qml/util/qqmllistcompositor_p.h @@ -166,7 +166,7 @@ public: struct Change { inline Change() {} - inline Change(iterator it, int count, uint flags, int moveId = -1); + inline Change(const iterator &it, int count, uint flags, int moveId = -1); int count; uint flags; int moveId; @@ -188,14 +188,14 @@ public: struct Insert : public Change { Insert() {} - Insert(iterator it, int count, uint flags, int moveId = -1) + Insert(const iterator &it, int count, uint flags, int moveId = -1) : Change(it, count, flags, moveId) {} }; struct Remove : public Change { Remove() {} - Remove(iterator it, int count, uint flags, int moveId = -1) + Remove(const iterator &it, int count, uint flags, int moveId = -1) : Change(it, count, flags, moveId) {} }; @@ -224,14 +224,14 @@ public: void setFlags(iterator from, int count, Group group, uint flags, QVector<Insert> *inserts = 0); void setFlags(Group fromGroup, int from, int count, uint flags, QVector<Insert> *inserts = 0) { setFlags(fromGroup, from, count, fromGroup, flags, inserts); } - void setFlags(iterator from, int count, uint flags, QVector<Insert> *inserts = 0) { + void setFlags(const iterator from, int count, uint flags, QVector<Insert> *inserts = 0) { setFlags(from, count, from.group, flags, inserts); } void clearFlags(Group fromGroup, int from, int count, Group group, uint flags, QVector<Remove> *removals = 0); void clearFlags(iterator from, int count, Group group, uint flags, QVector<Remove> *removals = 0); void clearFlags(Group fromGroup, int from, int count, uint flags, QVector<Remove> *removals = 0) { clearFlags(fromGroup, from, count, fromGroup, flags, removals); } - void clearFlags(iterator from, int count, uint flags, QVector<Remove> *removals = 0) { + void clearFlags(const iterator &from, int count, uint flags, QVector<Remove> *removals = 0) { clearFlags(from, count, from.group, flags, removals); } bool verifyMoveTo(Group fromGroup, int from, Group toGroup, int to, int count, Group group) const; @@ -347,7 +347,7 @@ inline QQmlListCompositor::insert_iterator::insert_iterator( Range *range, int offset, Group group, int groupCount) : iterator(range, offset, group, groupCount) {} -inline QQmlListCompositor::Change::Change(iterator it, int count, uint flags, int moveId) +inline QQmlListCompositor::Change::Change(const iterator &it, int count, uint flags, int moveId) : count(count), flags(flags), moveId(moveId) { for (int i = 0; i < MaximumGroupCount; ++i) diff --git a/src/qml/util/qqmlpropertymap.cpp b/src/qml/util/qqmlpropertymap.cpp index 2e95ab7cb5..28f3c8f215 100644 --- a/src/qml/util/qqmlpropertymap.cpp +++ b/src/qml/util/qqmlpropertymap.cpp @@ -172,8 +172,7 @@ int QQmlPropertyMapMetaObject::createProperty(const char *name, const char *valu modify or clear its associated value. \note When deriving a class from QQmlPropertyMap, use the - \l {QQmlPropertyMap::QQmlPropertyMap(DerivedType *derived, QObject *parent)} - {protected two-argument constructor} + \l {QQmlPropertyMap::QQmlPropertyMap(DerivedType *derived, QObject *parent)} {protected two-argument constructor} which ensures that the class is correctly registered with the Qt \l {Meta-Object System}. */ |