Revert "Fix Qt6 deprecation warning (QString::fromUcs4(uint))"

This reverts commit 52dff70641.
This commit is contained in:
Juergen Spitzmueller 2021-03-21 16:59:25 +01:00
parent 2c553df178
commit 4a5ae39e8b

View File

@ -47,21 +47,13 @@ QString toqstr(docstring const & ucs4)
// need to be superfast.
if (ucs4.empty())
return QString();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
return QString::fromStdWString(ucs4);
#else
return QString::fromUcs4((uint const *)ucs4.data(), ucs4.length());
#endif
}
QString toqstr(char_type ucs4)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
return QString::fromWCharArray(&ucs4, 1);
#else
union { char_type c; uint i; } u = { ucs4 };
return QString::fromUcs4(&u.i, 1);
#endif
}
docstring qstring_to_ucs4(QString const & qstr)