2020-05-27 20:30:26 +08:00
|
|
|
#include "MapSettingUI.h"
|
|
|
|
|
#include "ui_MapSettingUI.h"
|
|
|
|
|
|
|
|
|
|
MapSettingUI::MapSettingUI(QWidget *parent) :
|
|
|
|
|
QWidget(parent),
|
|
|
|
|
ui(new Ui::MapSettingUI)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
2020-05-28 18:11:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
//载入qss
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//载入配置
|
|
|
|
|
|
2020-05-27 20:30:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MapSettingUI::~MapSettingUI()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MapSettingUI::setMapProvider(QVariant value)
|
|
|
|
|
{
|
|
|
|
|
ui->pushButton_MapProvider->setText(value.toString());
|
|
|
|
|
|
2020-05-28 18:11:23 +08:00
|
|
|
emit setMapTypes(value);
|
2020-05-27 20:30:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MapSettingUI::MapTypes(QStringList list)
|
|
|
|
|
{
|
|
|
|
|
Selector *selector = new Selector(this);
|
|
|
|
|
selector->setGeometry(0,0,this->width(),this->height());
|
|
|
|
|
|
|
|
|
|
selector->setList(list,ui->pushButton_MapProvider->text());
|
|
|
|
|
|
|
|
|
|
connect(selector,SIGNAL(confirmValue(QVariant)),
|
|
|
|
|
this,SLOT(setMapProvider(QVariant)));
|
|
|
|
|
|
|
|
|
|
selector->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MapSettingUI::on_pushButton_MapProvider_clicked()
|
|
|
|
|
{
|
|
|
|
|
emit getMapTypes();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MapSettingUI::on_pushButton_Path_clicked()
|
|
|
|
|
{
|
2020-06-06 17:32:06 +08:00
|
|
|
QFileDialog *dlg = new QFileDialog(this);
|
2020-05-27 20:30:26 +08:00
|
|
|
|
2020-06-06 17:32:06 +08:00
|
|
|
dlg->setWindowTitle(tr("Select Path..."));
|
|
|
|
|
dlg->show();
|
|
|
|
|
|
|
|
|
|
QStringList sFileDir;
|
|
|
|
|
|
|
|
|
|
int ret = dlg->exec();
|
|
|
|
|
if (QDialog::Accepted == ret)
|
|
|
|
|
{
|
|
|
|
|
sFileDir = dlg->selectedFiles();
|
|
|
|
|
ui->pushButton_Path->setText(sFileDir.at(0));
|
|
|
|
|
|
|
|
|
|
QFontMetrics fmnotice(ui->pushButton_Path->font());
|
|
|
|
|
int wid = fmnotice.boundingRect(ui->pushButton_Path->text()).width();
|
|
|
|
|
ui->pushButton_Path->setFixedWidth(wid + 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2020-05-27 20:30:26 +08:00
|
|
|
}
|