Russian Qt Forum

Qt => Интернационализация, локализация => Тема начата: fear от Февраля 15, 2007, 12:42



Название: QLCDNumber - русский текст
Отправлено: fear от Февраля 15, 2007, 12:42
Возможно ли выводить русский текст через QLCDNumber? Есть ли аналог этому виджету подходяший для этих целей?

Код:
#include <QtGui/QApplication>
#include <QTextCodec>
#include <QLCDNumber>

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  QTextCodec *codec = QTextCodec::codecForName("utf8");
  QTextCodec::setCodecForTr(codec);

  QLCDNumber *number = new QLCDNumber;
  number->display(QObject::tr("Тест HELLO"));
  number->show();

  return app.exec();
}


Выводит только "HELLO" ...


Название: QLCDNumber - русский текст
Отправлено: Sergeich от Февраля 15, 2007, 14:49
А ты доку по нему читал?
Цитировать
These digits and other symbols can be shown: 0/O, 1, 2, 3, 4, 5/S, 6, 7, 8, 9/g, minus, decimal point, A, B, C, D, E, F, h, H, L, o, P, r, u, U, Y, colon, degree sign (which is specified as single quote in the string) and space. QLCDNumber substitutes spaces for illegal characters.