diff --git a/app/gui/oven_control/adjustmentwindow.cpp b/app/gui/oven_control/adjustmentwindow.cpp index a33d4bb..c2d9775 100644 --- a/app/gui/oven_control/adjustmentwindow.cpp +++ b/app/gui/oven_control/adjustmentwindow.cpp @@ -39,3 +39,36 @@ 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(focusWidget()); + if(btn != NULL){ + btn->click(); + } + break; + } + case 0x01000032: // Turn right + focusNextChild(); + break; + } +} diff --git a/app/gui/oven_control/adjustmentwindow.h b/app/gui/oven_control/adjustmentwindow.h index 04dbbb7..d416eae 100644 --- a/app/gui/oven_control/adjustmentwindow.h +++ b/app/gui/oven_control/adjustmentwindow.h @@ -2,6 +2,7 @@ #define ADJUSTMENTWINDOW_H #include +#include namespace Ui { class AdjustmentWindow; @@ -20,6 +21,10 @@ private slots: void on_backButton_clicked(); +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + private: Ui::AdjustmentWindow *ui; }; diff --git a/app/gui/oven_control/adjustmentwindow.ui b/app/gui/oven_control/adjustmentwindow.ui index d121902..7a6750e 100644 --- a/app/gui/oven_control/adjustmentwindow.ui +++ b/app/gui/oven_control/adjustmentwindow.ui @@ -142,6 +142,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b false + + Qt::NoFocus + QPushButton { border-image: url(:/images/config/pannel.png);color: rgb(255, 255, 255); } QPushButton:pressed { border-image: url(:/images/config/pannel_ov.png); } @@ -208,7 +211,7 @@ QPushButton { text-align: left;padding-left:30px;} QPushButton { border-image: url(:/images/config/service/089_set_window_all.png); } -QPushButton:pressed { border-image: url(:/images/config/service/089_set_window_all_ov.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/config/service/089_set_window_all_ov.png); } QPushButton { text-align: right; padding-right : 20px; diff --git a/app/gui/oven_control/configdoormonitoring.cpp b/app/gui/oven_control/configdoormonitoring.cpp index 50efedf..123750d 100644 --- a/app/gui/oven_control/configdoormonitoring.cpp +++ b/app/gui/oven_control/configdoormonitoring.cpp @@ -151,3 +151,22 @@ void ConfigDoorMonitoring::onBtnClicked(const int sel){ break; } } + +void ConfigDoorMonitoring::keyPressEvent(QKeyEvent *event){ + switch (event->key()) + { + case 0x01000030: // Turn left + focusPreviousChild(); + break; + case 0x01000031: // Push + + break; + case 0x01000032: // Turn right + focusNextChild(); + break; + } +} + +void ConfigDoorMonitoring::keyReleaseEvent(QKeyEvent *event){ + +} diff --git a/app/gui/oven_control/configdoormonitoring.h b/app/gui/oven_control/configdoormonitoring.h index 0c05798..cae5c49 100644 --- a/app/gui/oven_control/configdoormonitoring.h +++ b/app/gui/oven_control/configdoormonitoring.h @@ -3,6 +3,7 @@ #include #include +#include #include "config.h" @@ -25,6 +26,10 @@ private slots: void on_backButton_clicked(); void onBtnClicked(const int sel); +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + private: Ui::ConfigDoorMonitoring *ui; ConfigType m_nCfgType; diff --git a/app/gui/oven_control/configdoormonitoring.ui b/app/gui/oven_control/configdoormonitoring.ui index fe2d09d..c8ea5de 100644 --- a/app/gui/oven_control/configdoormonitoring.ui +++ b/app/gui/oven_control/configdoormonitoring.ui @@ -103,7 +103,7 @@ QPushButton { border-image: url(:/images/bottom_bar/back.png); } -QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); } @@ -126,7 +126,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); } QPushButton { border-image: url(:/images/bottom_bar/help.png); } -QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); } +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/help_ov.png); } diff --git a/app/gui/oven_control/configdutywashdlg.cpp b/app/gui/oven_control/configdutywashdlg.cpp index ddcbbe4..b44fa0e 100644 --- a/app/gui/oven_control/configdutywashdlg.cpp +++ b/app/gui/oven_control/configdutywashdlg.cpp @@ -16,6 +16,8 @@ ConfigDutyWashDlg::ConfigDutyWashDlg(QWidget *parent) : ui->setupUi(this); this->setWindowFlags( Qt::FramelessWindowHint); this->setAttribute( Qt::WA_DeleteOnClose); + qApp->setActiveWindow(this); + this->setFocus(); foreach (QPushButton *button, findChildren()) connect(button, &QPushButton::pressed, SoundPlayer::playClick); @@ -34,6 +36,11 @@ ConfigDutyWashDlg::ConfigDutyWashDlg(QWidget *parent) : connect(ui->pushButton_2,SIGNAL(clicked(bool)),m_pSignalMapper,SLOT(map())); connect(m_pSignalMapper,SIGNAL(mapped(int)),this,SLOT(onConfigBtnClicked(int))); + + m_vectorTabOrder.append(this); m_vectorTabOrder.append(ui->pushButton_1); + m_vectorTabOrder.append(ui->pushButton_2); + m_vectorTabOrder.append(ui->ctrBtnOk); + m_vectorTabOrder.append(ui->ctrBtnCancel); } ConfigDutyWashDlg::~ConfigDutyWashDlg() @@ -60,6 +67,105 @@ void ConfigDutyWashDlg::onConfigBtnClicked(const int sel){ m_nCurSel = sel; } +void ConfigDutyWashDlg::keyReleaseEvent(QKeyEvent *event) +{ + int i = 0; + switch (event->key()) + { + case 0x01000030: // Turn left + for(i = 0; i < m_vectorTabOrder.size();i++){ + if(focusWidget() == m_vectorTabOrder[i]) break; + } + + if(i==0){ + i = m_vectorTabOrder.size()-1; + m_vectorTabOrder[i]->setFocus(); + } + else if(i < m_vectorTabOrder.size()) { + i = i - 1; + m_vectorTabOrder[i]->setFocus(); + } + else{ + i=0; + m_vectorTabOrder[i]->setFocus(); + } + break; + case 0x01000031: // Push + { + QPushButton *btn = qobject_cast(focusWidget()); + if(btn != NULL){ + btn->click(); + } + break; + } + case 0x01000032: // Turn right + for(i = 0; i < m_vectorTabOrder.size();i++){ + if(focusWidget() == m_vectorTabOrder[i]) break; + } + + if(isetFocus(); + } + else if(i== (m_vectorTabOrder.size()-1)){ + i=0; + m_vectorTabOrder[i]->setFocus(); + } + else{ + i=0; + m_vectorTabOrder[i]->setFocus(); + } + break; + } +} + +void ConfigDutyWashDlg::keyPressEvent(QKeyEvent *event) +{ + int i = 0; + switch (event->key()) + { + case 0x01000030: // Turn left + for(i = 0; i < m_vectorTabOrder.size();i++){ + if(focusWidget() == m_vectorTabOrder[i]) break; + } + + if(i==0){ + i = m_vectorTabOrder.size()-1; + m_vectorTabOrder[i]->setFocus(); + } + else if(i < m_vectorTabOrder.size()) { + i = i - 1; + m_vectorTabOrder[i]->setFocus(); + } + else{ + i=0; + m_vectorTabOrder[i]->setFocus(); + } + break; + case 0x01000031: // Push + + break; + case 0x01000032: // Turn right + for(i = 0; i < m_vectorTabOrder.size();i++){ + if(focusWidget() == m_vectorTabOrder[i]) break; + } + + if(isetFocus(); + } + else if(i== (m_vectorTabOrder.size()-1)){ + i=0; + m_vectorTabOrder[i]->setFocus(); + } + else{ + i=0; + m_vectorTabOrder[i]->setFocus(); + } + break; + } +} + void ConfigDutyWashDlg::reloadUi(){ switch(m_nCurSel){ case 0: diff --git a/app/gui/oven_control/configdutywashdlg.h b/app/gui/oven_control/configdutywashdlg.h index 127531e..1f176e8 100644 --- a/app/gui/oven_control/configdutywashdlg.h +++ b/app/gui/oven_control/configdutywashdlg.h @@ -3,6 +3,8 @@ #include #include +#include +#include namespace Ui { class ConfigDutyWashDlg; @@ -25,10 +27,15 @@ private slots: void onConfigBtnClicked(const int sel); +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + private: Ui::ConfigDutyWashDlg *ui; QSignalMapper *m_pSignalMapper; int m_nCurSel; + QVector m_vectorTabOrder; }; #endif // CONFIGDUTYWASHDLG_H diff --git a/app/gui/oven_control/configfileprocessdlg.ui b/app/gui/oven_control/configfileprocessdlg.ui index 603274b..8939213 100644 --- a/app/gui/oven_control/configfileprocessdlg.ui +++ b/app/gui/oven_control/configfileprocessdlg.ui @@ -83,7 +83,7 @@ QPushButton::pressed, QPushButton::focus{ border-image : url(:/images/config/105_icon_cancel.png); } -QPushButton::pressed{ +QPushButton::pressed, QPushButton::focus{ border-image : url(:/images/config/105_icon_cancel_ov.png); } diff --git a/app/gui/oven_control/configinfodlg.cpp b/app/gui/oven_control/configinfodlg.cpp index 019307a..9effa69 100644 --- a/app/gui/oven_control/configinfodlg.cpp +++ b/app/gui/oven_control/configinfodlg.cpp @@ -13,6 +13,8 @@ ConfigInfoDlg::ConfigInfoDlg(QWidget *parent, ConfigType type) : ui->setupUi(this); this->setWindowFlags( Qt::FramelessWindowHint); this->setAttribute( Qt::WA_DeleteOnClose); + qApp->setActiveWindow(this); + this->setFocus(); foreach (QPushButton *button, findChildren()) connect(button, &QPushButton::pressed, SoundPlayer::playClick); @@ -33,6 +35,7 @@ ConfigInfoDlg::ConfigInfoDlg(QWidget *parent, ConfigType type) : loadSoftwareInfo(); break; } + ui->ctrBtnOk->setFocus(); } ConfigInfoDlg::~ConfigInfoDlg() @@ -129,3 +132,21 @@ void ConfigInfoDlg::loadHotlineServiceInfo(){ ui->gridLayout_info->addWidget(label,i,1); } } + +void ConfigInfoDlg::keyPressEvent(QKeyEvent *event){ + +} + +void ConfigInfoDlg::keyReleaseEvent(QKeyEvent *event){ + switch (event->key()) + { + case 0x01000031: // Push + { + QPushButton *btn = qobject_cast(focusWidget()); + if(btn != NULL){ + btn->click(); + } + break; + } + } +} diff --git a/app/gui/oven_control/configinfodlg.h b/app/gui/oven_control/configinfodlg.h index ec8f89c..85b3532 100644 --- a/app/gui/oven_control/configinfodlg.h +++ b/app/gui/oven_control/configinfodlg.h @@ -2,6 +2,7 @@ #define CONFIGINFODLG_H #include +#include #include "config.h" @@ -26,6 +27,10 @@ public: private slots: void on_ctrBtnOk_clicked(); +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + private: Ui::ConfigInfoDlg *ui; ConfigType m_nType; diff --git a/app/gui/oven_control/engineermenuwindow.h b/app/gui/oven_control/engineermenuwindow.h index 20d2f5d..fd6c625 100644 --- a/app/gui/oven_control/engineermenuwindow.h +++ b/app/gui/oven_control/engineermenuwindow.h @@ -2,6 +2,7 @@ #define ENGINEERMENUWINDOW_H #include +#include namespace Ui { class EngineerMenuWindow; @@ -34,6 +35,10 @@ private slots: void on_modelTypeConfigButton_clicked(); +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + private: Ui::EngineerMenuWindow *ui; diff --git a/app/gui/oven_control/functiontestwindow.cpp b/app/gui/oven_control/functiontestwindow.cpp index 189d3d3..d01e9e1 100644 --- a/app/gui/oven_control/functiontestwindow.cpp +++ b/app/gui/oven_control/functiontestwindow.cpp @@ -118,3 +118,35 @@ void FunctionTestWindow::onEncoderClicked(QWidget *clicked) if (b) b->click(); } + +void FunctionTestWindow::keyPressEvent(QKeyEvent *event){ + switch (event->key()) + { + case 0x01000030: // Turn left + focusPreviousChild(); + break; + case 0x01000032: // Turn right + focusNextChild(); + break; + } +} + +void FunctionTestWindow::keyReleaseEvent(QKeyEvent *event){ + switch (event->key()) + { + case 0x01000030: // Turn left + focusPreviousChild(); + break; + case 0x01000031: // Push + { + QPushButton *btn = qobject_cast(focusWidget()); + if(btn != NULL){ + btn->click(); + } + break; + } + case 0x01000032: // Turn right + focusNextChild(); + break; + } +} diff --git a/app/gui/oven_control/functiontestwindow.h b/app/gui/oven_control/functiontestwindow.h index 8c0a2d3..c491423 100644 --- a/app/gui/oven_control/functiontestwindow.h +++ b/app/gui/oven_control/functiontestwindow.h @@ -2,6 +2,7 @@ #define FUNCTIONTESTWINDOW_H #include +#include namespace Ui { class FunctionTestWindow; @@ -32,6 +33,10 @@ private slots: void on_gasTestButton_clicked(); +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + private: Ui::FunctionTestWindow *ui; diff --git a/app/gui/oven_control/usbcheckpopupdlg.ui b/app/gui/oven_control/usbcheckpopupdlg.ui index 8c0187b..5f5f724 100644 --- a/app/gui/oven_control/usbcheckpopupdlg.ui +++ b/app/gui/oven_control/usbcheckpopupdlg.ui @@ -55,7 +55,7 @@ border : none; color : white; } -QPushButton::pressed {color : yellow} +QPushButton::pressed, QPushButton:focus {color : yellow} 확인