-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatethemescreen.cpp
More file actions
35 lines (33 loc) · 1.34 KB
/
createthemescreen.cpp
File metadata and controls
35 lines (33 loc) · 1.34 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
#include "createthemescreen.h"
CreateThemeScreen::CreateThemeScreen(QWidget *parent) : QWidget(parent) {
vLayout = new QVBoxLayout(this);
nameLayout = new QHBoxLayout(vLayout->widget());
passwordLayout = new QHBoxLayout(vLayout->widget());
dateLayout = new QHBoxLayout(vLayout->widget());
nameLabel = new QLabel("Name: ", this);
passwordLabel = new QLabel("Password: ", this);
dateLabel = new QLabel("Date: ", this);
name = new QLineEdit(this);
password = new QLineEdit(this);
date = new QLineEdit(this);
createButton = new QPushButton("Create", this);
isNameEncoded = new QCheckBox("Is name encoded?", this);
isDataEncoded = new QCheckBox("Is data encoded?", this);
vLayout->addLayout(nameLayout);
vLayout->addLayout(passwordLayout);
vLayout->addLayout(dateLayout);
vLayout->addWidget(isNameEncoded);
vLayout->addWidget(isDataEncoded);
vLayout->addWidget(createButton);
nameLayout->addWidget(nameLabel);
nameLayout->addWidget(name);
passwordLayout->addWidget(passwordLabel);
passwordLayout->addWidget(password);
dateLayout->addWidget(dateLabel);
dateLayout->addWidget(date);
connect(createButton, &QPushButton::clicked, [=]() {
Theme theme;
theme.init(name->text().toStdString(), date->text().toStdString(), 0, 0);
createTheme(theme);
});
}