QTextCodec *rusCodec = QTextCodec::codecForName("UTF-8");QTextCodec::setCodecForTr(rusCodec);QTextCodec::setCodecForCStrings(rusCodec);
void KViewFlasher::drawBackground(QPainter *painter, const QRectF &rect){ Q_UNUSED(rect); QRectF sceneRect = this->sceneRect();... painter->drawText(textRect, "Старт 555");...}
QTextCodec *rusCodec = QTextCodec::codecForName("Windows-1251"); // в функции main QTextCodec::setCodecForTr(rusCodec); QTextCodec::setCodecForCStrings(rusCodec); blinkTextItem=addText(tr("Старт 555"));// в другой функции
int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; QTextCodec *rusCodec = QTextCodec::codecForName("CP1251"); QTextCodec::setCodecForTr(rusCodec); QTextCodec::setCodecForCStrings(rusCodec); w.show(); return a.exec();}
int main(int argc, char *argv[]){ QApplication a(argc, argv); QTextCodec *rusCodec = QTextCodec::codecForName("CP1251"); QTextCodec::setCodecForTr(rusCodec); QTextCodec::setCodecForCStrings(rusCodec); MainWindow w; w.show(); return a.exec();}