QFileDialog
is used in my code like following:
QFileDialog fileDlg;
fileDlg.setFileMode(QFileDialog::AnyFile);
fileDlg.setViewMode(QFileDialog::List);
fileDlg.setNameFilter("Excel Files(*.csv)");
fileDlg.setDefaultSuffix("csv");
fileDlg.setAcceptMode(QFileDialog::AcceptSave);
fileDlg.exec();
Unfortunately, this does not use text from the user's current locale. I would expect the save button to be "保存". Further, when I click on a dialog, the button's text is set to "Open", while it should be "打开" in my locale.
How can I provide localized strings to QFileDialog
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…