*/
inline QChar const ucs4_to_qchar(char_type const ucs4)
{
- // FIXME: The following cast is not a real conversion but it work
- // for the ucs2 subrange of unicode. Instead of an assertion we should
- // return some special characters that indicates that its display is
- // not supported.
BOOST_ASSERT(is_utf16(ucs4));
return QChar(static_cast<unsigned short>(ucs4));
}
#endif
-/**
- * ucs4_to_qstring - convert a UCS4 encoded char_type * into a QString
- *
- * This is a hack for the painter and font metrics and should not be used
- * elsewhere. Since it uses ucs4_to_qchar it has the same limitations.
- */
-inline void ucs4_to_qstring(char_type const * str, size_t ls, QString & s)
-{
- int i = static_cast<int>(ls);
- s.resize(i);
- for (; --i >= 0;)
- s[i] = ucs4_to_qchar(str[i]);
-}
-
-
/**
* qstring_to_ucs4 - convert a QString into a UCS4 encoded docstring
*