-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemapropertiesdialog.cpp
More file actions
83 lines (70 loc) · 2.18 KB
/
Copy pathschemapropertiesdialog.cpp
File metadata and controls
83 lines (70 loc) · 2.18 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "schemapropertiesdialog.hpp"
#include <QFormLayout>
#include <QLineEdit>
#include <QComboBox>
#include <QDialogButtonBox>
SchemaPropertiesDialog::SchemaPropertiesDialog(QWidget *parent)
: QDialog{parent},
m_name{new QLineEdit},
m_version{new QLineEdit},
m_type{new QComboBox},
m_prefix{new QLineEdit},
m_backspacePolicy{new QComboBox},
m_spacer{new QSpacerItem{20, 40, QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Expanding}},
m_buttonBox{new QDialogButtonBox{QDialogButtonBox::Ok|QDialogButtonBox::Cancel}}
{
setWindowTitle("Schema Properties");
resize(400, 200);
auto *layout = new QFormLayout{this};
layout->addRow("Name:", m_name);
layout->addRow("Version:", m_version);
m_type->addItems(QStringList{} << "Flat" << "Deep");
layout->addRow("Type:", m_type);
layout->addRow("Prefix:", m_prefix);
m_backspacePolicy->addItems(QStringList{} << "On different Letter (a == A)" << "On different Character (a != A)");
layout->addRow("Backspace:", m_backspacePolicy);
layout->addItem(m_spacer);
layout->addWidget(m_buttonBox);
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &SchemaPropertiesDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &SchemaPropertiesDialog::reject);
}
void SchemaPropertiesDialog::setName(const QString &name)
{
m_name->setText(name);
}
QString SchemaPropertiesDialog::name() const
{
return m_name->text();
}
void SchemaPropertiesDialog::setVersion(const QString &version)
{
m_version->setText(version);
}
QString SchemaPropertiesDialog::version() const
{
return m_version->text();
}
void SchemaPropertiesDialog::setType(int type)
{
m_type->setCurrentIndex(type);
}
int SchemaPropertiesDialog::type()
{
return m_type->currentIndex();
}
void SchemaPropertiesDialog::setPrefix(const QString &prefix)
{
m_prefix->setText(prefix);
}
QString SchemaPropertiesDialog::prefix() const
{
return m_prefix->text();
}
void SchemaPropertiesDialog::setBackspacePolicy(int policy)
{
m_backspacePolicy->setCurrentIndex(policy);
}
int SchemaPropertiesDialog::backspacePolicy() const
{
return m_backspacePolicy->currentIndex();
}