adjustmentwindow.cpp
1.69 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
#include <qdebug.h>
#include "adjustmentwindow.h"
#include "ui_adjustmentwindow.h"
#include "yesnopopupdlg.h"
#include "soundplayer.h"
AdjustmentWindow::AdjustmentWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::AdjustmentWindow)
{
ui->setupUi(this);
ui->clockContainer->setParent(ui->upperStack);
setAttribute(Qt::WA_DeleteOnClose);
foreach (QPushButton *button, findChildren<QPushButton *>())
connect(button, &QPushButton::pressed, SoundPlayer::playClick);
}
AdjustmentWindow::~AdjustmentWindow()
{
delete ui;
}
void AdjustmentWindow::on_btnAdjust_clicked()
{
YesNoPopupDlg* w = new YesNoPopupDlg(this,tr("모든 설정 값을 공장(출고)초기화\n값으로 변경 하시겠습니까?"));
//w->raise();
int dlgrst = w->exec();
dlgrst = w->result();
if(dlgrst == QDialog::Accepted) {
//Process Init Value;
qDebug() << "Accepted";
}
else qDebug() <<"Rejected";
}
void AdjustmentWindow::on_backButton_clicked()
{
close();
}
void AdjustmentWindow::keyPressEvent(QKeyEvent *event){
switch (event->key())
{
case 0x01000030: // Turn left
focusPreviousChild();
break;
case 0x01000032: // Turn right
focusNextChild();
break;
}
}
void AdjustmentWindow::keyReleaseEvent(QKeyEvent *event){
switch (event->key())
{
case 0x01000030: // Turn left
focusPreviousChild();
break;
case 0x01000031: // Push
{
QPushButton *btn = qobject_cast<QPushButton*>(focusWidget());
if(btn != NULL){
btn->click();
}
break;
}
case 0x01000032: // Turn right
focusNextChild();
break;
}
}