2 #include "ui_importsettings.h"
13 connect(ui->cbConfigs, SIGNAL(currentIndexChanged(
int)),
this, SLOT(updateDetails(
int)));
14 connect(ui->btnLoad, SIGNAL(clicked()),
this, SLOT(accept()));
15 QTimer::singleShot(500,
this, SLOT(repaint()));
22 QStringList list = myDir.entryList(filters, QDir::Files);
24 foreach (QString fileStr, list) {
25 fileInfo *info =
new fileInfo;
27 settings.beginGroup(
"General");
28 info->description = settings.value(
"Description",
"None").toString();
29 info->details = settings.value(
"Details",
"None").toString();
31 info->file = path + QDir::separator() + fileStr;
32 configList.insert(x, info);
33 ui->cbConfigs->addItem(info->description, x);
38 void importSettings::updateDetails(
int index)
40 fileInfo *info = configList.value(ui->cbConfigs->itemData(index).toInt());
41 ui->lblDetails->setText(info->details);
46 configList.value(ui->cbConfigs->itemData(ui->cbConfigs->currentIndex()).toInt());
52 foreach (fileInfo *info, configList.values()) {
importSettings(QWidget *parent=nullptr)
static const QSettings::Format XmlSettingsFormat
void loadFiles(QString path)