0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-23 16:22:58 +03:00
LimeReport/limereport/translationeditor/languageselectdialog.cpp
Андрей Лухнов 0fca7169d3 Define code style and format all source file using clang-format-14
except those placed in 3rdparty directories.
2024-09-19 21:09:38 +03:00

30 lines
823 B
C++

#include "languageselectdialog.h"
#include "ui_languageselectdialog.h"
#include <QDebug>
#include <QLocale>
#include <QSet>
LanguageSelectDialog::LanguageSelectDialog(QWidget* parent):
QDialog(parent),
ui(new Ui::LanguageSelectDialog)
{
ui->setupUi(this);
for (int i = 2; i < QLocale::LastLanguage; ++i) {
ui->comboBox->addItem(QLocale::languageToString(static_cast<QLocale::Language>(i)),
static_cast<QLocale::Language>(i));
}
#if QT_VERSION < 0x050000
ui->comboBox->setEditText("");
#else
ui->comboBox->setCurrentText("");
#endif
}
LanguageSelectDialog::~LanguageSelectDialog() { delete ui; }
QLocale::Language LanguageSelectDialog::getSelectedLanguage()
{
return ui->comboBox->itemData(ui->comboBox->currentIndex()).value<QLocale::Language>();
}