diff --git a/src/frontends/qt2/QLPainter.C b/src/frontends/qt2/QLPainter.C index 471e00ed3c..197f39f315 100644 --- a/src/frontends/qt2/QLPainter.C +++ b/src/frontends/qt2/QLPainter.C @@ -257,14 +257,16 @@ Painter & QLPainter::text(int x, int y, encoding = encodings.symbol_encoding(); QString str; +#if QT_VERSION >= 0x030000 str.setLength(ls); for (size_t i = 0; i < ls; ++i) str[i] = QChar(encoding->ucs(s[i])); - -#if QT_VERSION >= 0x030000 // HACK: QT3 refuses to show single compose characters if (ls = 1 && str[0].unicode() >= 0x05b0 && str[0].unicode() <= 0x05c2) str = ' '+str; +#else + for (size_t i = 0; i < ls; ++i) + str += QChar(encoding->ucs(s[i])); #endif if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) { diff --git a/src/frontends/qt2/qfont_metrics.C b/src/frontends/qt2/qfont_metrics.C index 57b65a2eb1..44992d5049 100644 --- a/src/frontends/qt2/qfont_metrics.C +++ b/src/frontends/qt2/qfont_metrics.C @@ -85,9 +85,14 @@ int width(char const * s, size_t ls, LyXFont const & f) encoding = encodings.symbol_encoding(); QString str; +#if QT_VERSION >= 0x030000 str.setLength(ls); for (size_t i = 0; i < ls; ++i) str[i] = QChar(encoding->ucs(s[i])); +#else + for (size_t i = 0; i < ls; ++i) + str += QChar(encoding->ucs(s[i])); +#endif if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) { return metrics(f).width(str);