0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-26 09:28:11 +03:00
LimeReport/limereport/translationeditor/languageselectdialog.cpp

32 lines
800 B
C++
Raw Normal View History

2017-08-16 01:18:56 +03:00
#include "languageselectdialog.h"
#include "ui_languageselectdialog.h"
#include <QLocale>
#include <QSet>
#include <QDebug>
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));
}
2017-10-26 12:24:06 +03:00
#ifdef HAVE_QT5
2017-08-16 01:18:56 +03:00
ui->comboBox->setCurrentText("");
2017-10-26 12:24:06 +03:00
#endif
#ifdef HAVE_QT4
ui->comboBox->setEditText("");
#endif
2017-08-16 01:18:56 +03:00
}
LanguageSelectDialog::~LanguageSelectDialog()
{
delete ui;
}
QLocale::Language LanguageSelectDialog::getSelectedLanguage()
{
return ui->comboBox->itemData(ui->comboBox->currentIndex()).value<QLocale::Language>();
}