aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmllistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/types/qqmllistmodel.cpp')
-rw-r--r--src/qml/types/qqmllistmodel.cpp8
1 files changed, 4 insertions, 4 deletions
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;
}