model->addData(model->index(row, column), translated_text, Qt::DisplayRole);
// If translation is english
model
->addData
(model
->index
(row, column
),
QFont("Arial",
12), Qt
::FontRole);
// If translation is chinese
model
->addData
(model
->index
(row, column
),
QFont("SimSun",
12), Qt
::FontRole);
QString translated_text = QApplication::translate("Languages", "LanguageName");
model->addData(model->index(row, column), translated_text, Qt::DisplayRole);
// If translation is english
model->addData(model->index(row, column), QFont("Arial", 12), Qt::FontRole);
// If translation is chinese
model->addData(model->index(row, column), QFont("SimSun", 12), Qt::FontRole);
To copy to clipboard, switch view to plain text mode
Bookmarks