2017-08-16 01:18:56 +03:00
|
|
|
#include "languageselectdialog.h"
|
|
|
|
#include "ui_languageselectdialog.h"
|
2024-09-04 17:31:16 +03:00
|
|
|
|
|
|
|
#include <QDebug>
|
2017-08-16 01:18:56 +03:00
|
|
|
#include <QLocale>
|
|
|
|
#include <QSet>
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
LanguageSelectDialog::LanguageSelectDialog(QWidget* parent):
|
2017-08-16 01:18:56 +03:00
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::LanguageSelectDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2024-09-04 17:31:16 +03:00
|
|
|
for (int i = 2; i < QLocale::LastLanguage; ++i) {
|
|
|
|
ui->comboBox->addItem(QLocale::languageToString(static_cast<QLocale::Language>(i)),
|
|
|
|
static_cast<QLocale::Language>(i));
|
2017-08-16 01:18:56 +03:00
|
|
|
}
|
2021-08-23 08:07:08 +03:00
|
|
|
#if QT_VERSION < 0x050000
|
2017-10-26 12:24:06 +03:00
|
|
|
ui->comboBox->setEditText("");
|
2021-08-23 08:07:08 +03:00
|
|
|
#else
|
|
|
|
ui->comboBox->setCurrentText("");
|
2017-10-26 12:24:06 +03:00
|
|
|
#endif
|
2017-08-16 01:18:56 +03:00
|
|
|
}
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
LanguageSelectDialog::~LanguageSelectDialog() { delete ui; }
|
2017-08-16 01:18:56 +03:00
|
|
|
|
|
|
|
QLocale::Language LanguageSelectDialog::getSelectedLanguage()
|
|
|
|
{
|
|
|
|
return ui->comboBox->itemData(ui->comboBox->currentIndex()).value<QLocale::Language>();
|
|
|
|
}
|