Good evening,
I am currently trying my hand at a small program with QT and have now encountered the following problem:
I have created a translation file and specified what I want to translate in the code using "tr("")". In QT Linguist I can also translate these entries successfully.
Loading the translation also works perfectly.
However, I have a QStringList to fill a QTableWidget with the header information. There I have also specified the "tr("")", which is also displayed in QLinguist.
However, no translation is displayed in the window even after recompiling.
To rule out a direct error, I simply translated a QLabel and set it directly in the code like this: ui.qLabel->setText(tr("Hello"));
I then "translated" this in QLinguist using lrelease and created the *qm file again and tried it out. This translation is displayed to me.
I have the following as QStringList:
headerLabels << tr("Order ID") << tr("Order Number") << tr("Line or machine") << tr("Order priority") << tr("Storage location") << tr("Article name") << tr("Article number") << tr("Article Quantity");
headerLabels << tr("Ordered first name") << tr("Orderer last name") << tr("More information") << tr("Cost unit") << tr("Order date");
QStringList headerLabels;
headerLabels << tr("Order ID") << tr("Order Number") << tr("Line or machine") << tr("Order priority") << tr("Storage location") << tr("Article name") << tr("Article number") << tr("Article Quantity");
headerLabels << tr("Ordered first name") << tr("Orderer last name") << tr("More information") << tr("Cost unit") << tr("Order date");
To copy to clipboard, switch view to plain text mode
and set it with
ui.QTableWidghet->setHorizontalHeaderLabels(headerLabels);
ui.QTableWidghet->setHorizontalHeaderLabels(headerLabels);
To copy to clipboard, switch view to plain text mode
What else could be the reason that the translation is not displayed like this?
Many thanks for the answers.
Sevi
Bookmarks