E
E
Evgeny Yakushov2020-10-05 13:34:18
Qt
Evgeny Yakushov, 2020-10-05 13:34:18

QT how to translate unicode to character?

I've already broken my head. There is a Cyrillic character code, it needs to be displayed in qtextedit, but I do not understand how to convert it to a character.
I'm trying like this:

// Например, codeSymbol = 1040 - это "А"
ui->textEdit->insertPlainText(QString(char(codeSymbol)));
// и так
ui->textEdit->insertPlainText(QString(codeSymbol));

As a result, crooked symbols are displayed
5f7af64e6ee4d220989595.png
Help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xibir, 2020-10-05
@yevgenyyakushov

ui->textEdit->insertPlainText(QString(QChar(codeSymbol)));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question