-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.cpp
44 lines (37 loc) · 1.11 KB
/
dialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "dialog.h"
#include <QLayout>
#include <QLineEdit>
#include <QTabWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QDebug>
Dialog::Dialog(QString file) :
QDialog(0), m_settings(file, QSettings::IniFormat)
{
setLayout(new QVBoxLayout);
QTabWidget *tabWidget = new QTabWidget;
layout()->addWidget(tabWidget);
foreach(QString groupHeader, m_settings.childGroups()) {
m_settings.beginGroup(groupHeader);
QWidget *w = new QWidget;
QVBoxLayout *l = new QVBoxLayout;
w->setLayout(l);
foreach(QString item, m_settings.childKeys()) {
QWidget *line = new QWidget;
line->setLayout(new QHBoxLayout);
QLabel *label = new QLabel(item);
QLineEdit *edit = new QLineEdit;
edit->setText(m_settings.value(item).toString());
line->layout()->addWidget(label);
line->layout()->addWidget(edit);
l->addWidget(line);
}
l->addStretch();
tabWidget->addTab(w, groupHeader);
m_settings.endGroup();
}
}
Dialog::~Dialog()
{
}