#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()) 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(clicked); if (b) b->click(); }