Unicode characters are not displayed in qt application

I am trying to display different language strings in my qt application by inserting each language in QMap<QString, QString>so that it can be reused in several places and placed in different combined fields in the application. I do this by creating QMap, as in CTOR:

m_langMap.insert(QString::fromWCharArray(L"English"), "english");
m_langMap.insert(QString::fromWCharArray(L"Dansk"), "dansk");
m_langMap.insert(QString::fromWCharArray(L"Nederlands"), "dutch");
m_langMap.insert(QString::fromWCharArray(L"Čeština"), "czeck");
m_langMap.insert(QString::fromWCharArray(L"Slovenský"), "slovak");
m_langMap.insert(QString::fromWCharArray(L"Magyar"), "hungarian");
m_langMap.insert(QString::fromWCharArray(L"Român"), "romanian");
m_langMap.insert(QString::fromWCharArray(L"Latviešu"), "latvian");
m_langMap.insert(QString::fromWCharArray(L"Lietuvių"), "lithuanian");
m_langMap.insert(QString::fromWCharArray(L"Polski"), "polish");
m_langMap.insert(QString::fromWCharArray(L"Português"), "portuguese");
m_langMap.insert(QString::fromWCharArray(L"Español"), "spanish");
m_langMap.insert(QString::fromWCharArray(L"Français"), "french");
m_langMap.insert(QString::fromWCharArray(L"Italiano"), "italian");
m_langMap.insert(QString::fromWCharArray(L"Svenska"), "swedish");
m_langMap.insert(QString::fromWCharArray(L""), "russian");
m_langMap.insert(QString::fromWCharArray(L"ї"), "ukranian");
m_langMap.insert(QString::fromWCharArray(L""), "russian");
m_langMap.insert(QString::fromWCharArray(L"中文"), "chinese");
m_langMap.insert(QString::fromWCharArray(L"日本語"), "japanese");

Then I paste them into the combo box:

QMap<QString, QString>::const_iterator it = m_langMap.begin();
while (it != m_langMap.end())
{
    ui->comboBox->addItem(it.key());
    ++it;
}

When the application starts, I see the following:

enter image description here

However, if I create a separate .ui file and insert the card in the same way, I see the following (even if I include this separate Dialog class in the same application), therefore it is clear that the font problem is missing, the application does not know how to render different character sets .... yet I can't figure out why the first one won't display character sets?

- , , ? , Locale "C, Default" ui, . , , , .

!

:

enter image description here

+5
2

, , Unicode - , .

UTF-8, !

enter image description here

+1

, combobox, , . , GUI, , () . , , . , , - .

0

All Articles