mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-26 13:28:09 +03:00
32 lines
800 B
C++
32 lines
800 B
C++
#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));
|
|
}
|
|
#ifdef HAVE_QT5
|
|
ui->comboBox->setCurrentText("");
|
|
#endif
|
|
#ifdef HAVE_QT4
|
|
ui->comboBox->setEditText("");
|
|
#endif
|
|
}
|
|
|
|
LanguageSelectDialog::~LanguageSelectDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
QLocale::Language LanguageSelectDialog::getSelectedLanguage()
|
|
{
|
|
return ui->comboBox->itemData(ui->comboBox->currentIndex()).value<QLocale::Language>();
|
|
}
|