diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index ba07259e77..5894b869da 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -958,8 +958,9 @@ inline int QString::toWCharArray(wchar_t *array) const if (sizeof(wchar_t) == sizeof(QChar)) { memcpy(array, d->data(), sizeof(QChar) * size()); return size(); + } else { + return toUcs4_helper(d->data(), size(), reinterpret_cast(array)); } - return toUcs4_helper(d->data(), size(), reinterpret_cast(array)); } QT_WARNING_POP