diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index ac77d898da4..c3805107dc9 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -311,11 +311,14 @@ public: SignalVector *newVector = reinterpret_cast(malloc(sizeof(SignalVector) + (size + 1) * sizeof(ConnectionList))); int start = -1; if (vector) { + // not (yet) existing trait: + //static_assert(std::is_relocatable_v); + //static_assert(std::is_relocatable_v); memcpy(newVector, vector, sizeof(SignalVector) + (vector->allocated + 1) * sizeof(ConnectionList)); start = vector->count(); } for (int i = start; i < int(size); ++i) - newVector->at(i) = ConnectionList(); + new (&newVector->at(i)) ConnectionList(); newVector->next = nullptr; newVector->allocated = size;