-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetView.cpp
119 lines (103 loc) · 3 KB
/
SetView.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include "SignalGenerator.h"
#include "BaseWidget.h"
#include "SetView.h"
#include "Task.h"
#include<Windows.h>
#include<QWidget>
#include<QSlider>
#include<QSpinBox>
#include<QPalette>
#include<QFont>
#include<QHBoxLayout>
#include<QRect>
#include<QPoint>
#include<QPushButton>
#include<QTextEdit>
#include<QCheckBox>
#include<QComboBox>
#include<QUrl>
#include<QFileDialog>
SetView::SetView(QWidget *parent) : BaseWidget(parent)
{
setWindowTitle(QString::fromLocal8Bit("零"));
setFixedSize(640, 480);
QFont font;
font = QFont("Times", 16, 32, false);
font.setBold(true);
QPalette pe;
pe.setColor(QPalette::WindowText, Qt::white);
VH = new QCheckBox(this);
VH->setText(QString::fromLocal8Bit("꽉데으땅零"));
VH->setFont(font);
VH->setPalette(pe);
Fram = new QCheckBox(this);
Fram->setText(QString::fromLocal8Bit("숌썅뺏눗왯"));
Fram->setFont(font);
Fram->setPalette(pe);
hSlider = new QSlider(this);
hSlider->setWindowIconText(QString::fromLocal8Bit("Set The Windows Style"));
hSlider->setOrientation(Qt::Horizontal);
hSlider->setMaximum(100);
hSlider->setFixedWidth(180);
hSlider->setSingleStep(1);
spinBox = new QSpinBox(this);
spinBox->setFixedWidth(50);
spinBox->setMaximum(100);
QHBoxLayout *hlayout1 = new QHBoxLayout();
hlayout1->setSpacing(50);
hlayout1->addWidget(hSlider);
hlayout1->addWidget(spinBox);
BackButton = new QPushButton(QIcon("./Resources/cancel.png"), tr(""), this);
BackButton->setStatusTip(tr("럿쀼"));
BackButton->setFixedSize(QSize(45, 45));
BackButton->setIconSize(QSize(45, 45));
OKButton = new QPushButton(QIcon("./Resources/ok.png"), tr(""), this);
OKButton->setStatusTip(tr("럿쀼"));
OKButton->setFixedSize(QSize(45, 45));
OKButton->setIconSize(QSize(45, 45));
QHBoxLayout *hlayout = new QHBoxLayout();
hlayout->setSpacing(50);
hlayout->addWidget(BackButton);
hlayout->addWidget(OKButton);
QVBoxLayout *vlayout = new QVBoxLayout(this);
vlayout->setSpacing(50);
vlayout->setAlignment(Qt::AlignCenter);
vlayout->addWidget(VH);
vlayout->addWidget(Fram);
vlayout->addLayout(hlayout1);
vlayout->addLayout(hlayout);
connect(VH, SIGNAL(stateChanged(int)), this, SLOT(setVH(int)));
connect(Fram, SIGNAL(stateChanged(int)), this, SLOT(setFramless(int)));
connect(hSlider, SIGNAL(valueChanged(int)), this, SLOT(setOpacity(int)));
connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(setOpacity(int)));
connect(BackButton, SIGNAL(clicked()), this, SLOT(close()));
connect(OKButton, SIGNAL(clicked()), this, SLOT(close()));
}
SetView::~SetView()
{
delete VH;
delete Fram;
delete spinBox;
delete hSlider;
delete BackButton;
delete OKButton;
}
void SetView::setOpacity(int value)
{
BaseWidget::v = (100.0 - value) / 100.0;
setWindowOpacity(BaseWidget::v);
spinBox->setValue(value);
hSlider->setValue(value);
emit updateOpacity(value);
}
void SetView::setVH(int value)
{
emit updateVH(value);
}
void SetView::setFramless(int value)
{
if(value) setWindowFlags(Qt::FramelessWindowHint);
else setWindowFlags(Qt::WindowCloseButtonHint);
emit updateFramless(value);
show();
}