diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-26 09:43:33 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-26 09:51:56 +0200 |
commit | e9e6f70d355499d551a26960d236644f92ea38af (patch) | |
tree | 542840d4b3b8ff82d6fab38c9ad2615d3592b793 /src/qml/types | |
parent | 916ced089f37d96ca8ef1cdb938791247bd44b72 (diff) | |
parent | eadc35f499edd25d5d1c5f803db1d61675c1cc2c (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
src/qml/qml/qqmlobjectcreator_p.h
Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmldelegatemodel_p_p.h | 2 | ||||
-rw-r--r-- | src/qml/types/qqmlinstantiator.cpp | 1 | ||||
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 8 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h index f8002a43ad..a7def0ad50 100644 --- a/src/qml/types/qqmldelegatemodel_p_p.h +++ b/src/qml/types/qqmldelegatemodel_p_p.h @@ -135,7 +135,7 @@ public: QV4::ExecutionEngine *v4; QQmlDelegateModelItemMetaType * const metaType; QQmlContextData *contextData; - QObject *object; + QPointer<QObject> object; QPointer<QQmlDelegateModelAttached> attached; QQDMIncubationTask *incubationTask; int objectRef; diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp index eba2d4b668..891011081d 100644 --- a/src/qml/types/qqmlinstantiator.cpp +++ b/src/qml/types/qqmlinstantiator.cpp @@ -368,6 +368,7 @@ void QQmlInstantiator::setModel(const QVariant &v) if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) { if (d->ownModel) { delete d->instanceModel; + prevModel = 0; d->ownModel = false; } d->instanceModel = vim; diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 4fca11b511..25879972ca 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -802,7 +802,7 @@ int ListElement::setDoubleProperty(const ListLayout::Role &role, double d) if (role.type == ListLayout::Role::Number) { char *mem = getPropertyMemory(role); - double *value = new (mem) double; + double *value = reinterpret_cast<double *>(mem); bool changed = *value != d; *value = d; if (changed) @@ -818,7 +818,7 @@ int ListElement::setBoolProperty(const ListLayout::Role &role, bool b) if (role.type == ListLayout::Role::Bool) { char *mem = getPropertyMemory(role); - bool *value = new (mem) bool; + bool *value = reinterpret_cast<bool *>(mem); bool changed = *value != b; *value = b; if (changed) @@ -834,8 +834,8 @@ int ListElement::setListProperty(const ListLayout::Role &role, ListModel *m) if (role.type == ListLayout::Role::List) { char *mem = getPropertyMemory(role); - ListModel **value = new (mem) ListModel *; - if (*value) { + ListModel **value = reinterpret_cast<ListModel **>(mem); + if (*value && *value != m) { (*value)->destroy(); delete *value; } |