basicsettingwindow.cpp
863 Bytes
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
#include "basicsettingwindow.h"
#include "ui_basicsettingwindow.h"
#include "soundplayer.h"
BasicSettingWindow::BasicSettingWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::BasicSettingWindow)
{
ui->setupUi(this);
foreach (QPushButton *button, findChildren<QPushButton *>())
connect(button, &QPushButton::pressed, SoundPlayer::playClick);
}
BasicSettingWindow::~BasicSettingWindow()
{
delete ui;
}
void BasicSettingWindow::keyPressEvent(QKeyEvent *event)
{
}
void BasicSettingWindow::keyReleaseEvent(QKeyEvent *event)
{
}
void BasicSettingWindow::onEncoderLeft()
{
focusPreviousChild();
}
void BasicSettingWindow::onEncoderRight()
{
focusNextChild();
}
void BasicSettingWindow::onEncoderClicked(QWidget *clicked)
{
QPushButton *b = qobject_cast<QPushButton *>(clicked);
if (b)
b->click();
}