Commit ce39b99ffcd3228993bde945400d3f8994d98602
1 parent
9e1f8d0933
Exists in
master
and in
2 other branches
엔코더 구현 진행중
- 엔지니어 모드 기능테스트 메뉴까지
Showing
15 changed files
with
251 additions
and
5 deletions
Show diff stats
app/gui/oven_control/adjustmentwindow.cpp
| @@ -39,3 +39,36 @@ void AdjustmentWindow::on_backButton_clicked() | @@ -39,3 +39,36 @@ void AdjustmentWindow::on_backButton_clicked() | ||
| 39 | { | 39 | { |
| 40 | close(); | 40 | close(); |
| 41 | } | 41 | } |
| 42 | + | ||
| 43 | + | ||
| 44 | +void AdjustmentWindow::keyPressEvent(QKeyEvent *event){ | ||
| 45 | + switch (event->key()) | ||
| 46 | + { | ||
| 47 | + case 0x01000030: // Turn left | ||
| 48 | + focusPreviousChild(); | ||
| 49 | + break; | ||
| 50 | + case 0x01000032: // Turn right | ||
| 51 | + focusNextChild(); | ||
| 52 | + break; | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +void AdjustmentWindow::keyReleaseEvent(QKeyEvent *event){ | ||
| 57 | + switch (event->key()) | ||
| 58 | + { | ||
| 59 | + case 0x01000030: // Turn left | ||
| 60 | + focusPreviousChild(); | ||
| 61 | + break; | ||
| 62 | + case 0x01000031: // Push | ||
| 63 | + { | ||
| 64 | + QPushButton *btn = qobject_cast<QPushButton*>(focusWidget()); | ||
| 65 | + if(btn != NULL){ | ||
| 66 | + btn->click(); | ||
| 67 | + } | ||
| 68 | + break; | ||
| 69 | + } | ||
| 70 | + case 0x01000032: // Turn right | ||
| 71 | + focusNextChild(); | ||
| 72 | + break; | ||
| 73 | + } | ||
| 74 | +} |
app/gui/oven_control/adjustmentwindow.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define ADJUSTMENTWINDOW_H | 2 | #define ADJUSTMENTWINDOW_H |
| 3 | 3 | ||
| 4 | #include <QMainWindow> | 4 | #include <QMainWindow> |
| 5 | +#include <QKeyEvent> | ||
| 5 | 6 | ||
| 6 | namespace Ui { | 7 | namespace Ui { |
| 7 | class AdjustmentWindow; | 8 | class AdjustmentWindow; |
| @@ -20,6 +21,10 @@ private slots: | @@ -20,6 +21,10 @@ private slots: | ||
| 20 | 21 | ||
| 21 | void on_backButton_clicked(); | 22 | void on_backButton_clicked(); |
| 22 | 23 | ||
| 24 | +protected: | ||
| 25 | + void keyReleaseEvent(QKeyEvent* event); | ||
| 26 | + void keyPressEvent(QKeyEvent* event); | ||
| 27 | + | ||
| 23 | private: | 28 | private: |
| 24 | Ui::AdjustmentWindow *ui; | 29 | Ui::AdjustmentWindow *ui; |
| 25 | }; | 30 | }; |
app/gui/oven_control/adjustmentwindow.ui
| @@ -142,6 +142,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b | @@ -142,6 +142,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b | ||
| 142 | <underline>false</underline> | 142 | <underline>false</underline> |
| 143 | </font> | 143 | </font> |
| 144 | </property> | 144 | </property> |
| 145 | + <property name="focusPolicy"> | ||
| 146 | + <enum>Qt::NoFocus</enum> | ||
| 147 | + </property> | ||
| 145 | <property name="styleSheet"> | 148 | <property name="styleSheet"> |
| 146 | <string notr="true">QPushButton { border-image: url(:/images/config/pannel.png);color: rgb(255, 255, 255); } | 149 | <string notr="true">QPushButton { border-image: url(:/images/config/pannel.png);color: rgb(255, 255, 255); } |
| 147 | QPushButton:pressed { border-image: url(:/images/config/pannel_ov.png); } | 150 | QPushButton:pressed { border-image: url(:/images/config/pannel_ov.png); } |
| @@ -208,7 +211,7 @@ QPushButton { text-align: left;padding-left:30px;} | @@ -208,7 +211,7 @@ QPushButton { text-align: left;padding-left:30px;} | ||
| 208 | </property> | 211 | </property> |
| 209 | <property name="styleSheet"> | 212 | <property name="styleSheet"> |
| 210 | <string notr="true">QPushButton { border-image: url(:/images/config/service/089_set_window_all.png); } | 213 | <string notr="true">QPushButton { border-image: url(:/images/config/service/089_set_window_all.png); } |
| 211 | -QPushButton:pressed { border-image: url(:/images/config/service/089_set_window_all_ov.png); } | 214 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/config/service/089_set_window_all_ov.png); } |
| 212 | QPushButton { | 215 | QPushButton { |
| 213 | text-align: right; | 216 | text-align: right; |
| 214 | padding-right : 20px; | 217 | padding-right : 20px; |
app/gui/oven_control/configdoormonitoring.cpp
| @@ -151,3 +151,22 @@ void ConfigDoorMonitoring::onBtnClicked(const int sel){ | @@ -151,3 +151,22 @@ void ConfigDoorMonitoring::onBtnClicked(const int sel){ | ||
| 151 | break; | 151 | break; |
| 152 | } | 152 | } |
| 153 | } | 153 | } |
| 154 | + | ||
| 155 | +void ConfigDoorMonitoring::keyPressEvent(QKeyEvent *event){ | ||
| 156 | + switch (event->key()) | ||
| 157 | + { | ||
| 158 | + case 0x01000030: // Turn left | ||
| 159 | + focusPreviousChild(); | ||
| 160 | + break; | ||
| 161 | + case 0x01000031: // Push | ||
| 162 | + | ||
| 163 | + break; | ||
| 164 | + case 0x01000032: // Turn right | ||
| 165 | + focusNextChild(); | ||
| 166 | + break; | ||
| 167 | + } | ||
| 168 | +} | ||
| 169 | + | ||
| 170 | +void ConfigDoorMonitoring::keyReleaseEvent(QKeyEvent *event){ | ||
| 171 | + | ||
| 172 | +} |
app/gui/oven_control/configdoormonitoring.h
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | 3 | ||
| 4 | #include <QMainWindow> | 4 | #include <QMainWindow> |
| 5 | #include <QSignalMapper> | 5 | #include <QSignalMapper> |
| 6 | +#include <QKeyEvent> | ||
| 6 | #include "config.h" | 7 | #include "config.h" |
| 7 | 8 | ||
| 8 | 9 | ||
| @@ -25,6 +26,10 @@ private slots: | @@ -25,6 +26,10 @@ private slots: | ||
| 25 | void on_backButton_clicked(); | 26 | void on_backButton_clicked(); |
| 26 | void onBtnClicked(const int sel); | 27 | void onBtnClicked(const int sel); |
| 27 | 28 | ||
| 29 | +protected: | ||
| 30 | + void keyReleaseEvent(QKeyEvent* event); | ||
| 31 | + void keyPressEvent(QKeyEvent* event); | ||
| 32 | + | ||
| 28 | private: | 33 | private: |
| 29 | Ui::ConfigDoorMonitoring *ui; | 34 | Ui::ConfigDoorMonitoring *ui; |
| 30 | ConfigType m_nCfgType; | 35 | ConfigType m_nCfgType; |
app/gui/oven_control/configdoormonitoring.ui
| @@ -103,7 +103,7 @@ | @@ -103,7 +103,7 @@ | ||
| 103 | </property> | 103 | </property> |
| 104 | <property name="styleSheet"> | 104 | <property name="styleSheet"> |
| 105 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } | 105 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } |
| 106 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</string> | 106 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); }</string> |
| 107 | </property> | 107 | </property> |
| 108 | <property name="text"> | 108 | <property name="text"> |
| 109 | <string/> | 109 | <string/> |
| @@ -126,7 +126,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str | @@ -126,7 +126,7 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str | ||
| 126 | </property> | 126 | </property> |
| 127 | <property name="styleSheet"> | 127 | <property name="styleSheet"> |
| 128 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } | 128 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/help.png); } |
| 129 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); }</string> | 129 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/help_ov.png); }</string> |
| 130 | </property> | 130 | </property> |
| 131 | <property name="text"> | 131 | <property name="text"> |
| 132 | <string/> | 132 | <string/> |
app/gui/oven_control/configdutywashdlg.cpp
| @@ -16,6 +16,8 @@ ConfigDutyWashDlg::ConfigDutyWashDlg(QWidget *parent) : | @@ -16,6 +16,8 @@ ConfigDutyWashDlg::ConfigDutyWashDlg(QWidget *parent) : | ||
| 16 | ui->setupUi(this); | 16 | ui->setupUi(this); |
| 17 | this->setWindowFlags( Qt::FramelessWindowHint); | 17 | this->setWindowFlags( Qt::FramelessWindowHint); |
| 18 | this->setAttribute( Qt::WA_DeleteOnClose); | 18 | this->setAttribute( Qt::WA_DeleteOnClose); |
| 19 | + qApp->setActiveWindow(this); | ||
| 20 | + this->setFocus(); | ||
| 19 | 21 | ||
| 20 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 22 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 21 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 23 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| @@ -34,6 +36,11 @@ ConfigDutyWashDlg::ConfigDutyWashDlg(QWidget *parent) : | @@ -34,6 +36,11 @@ ConfigDutyWashDlg::ConfigDutyWashDlg(QWidget *parent) : | ||
| 34 | connect(ui->pushButton_2,SIGNAL(clicked(bool)),m_pSignalMapper,SLOT(map())); | 36 | connect(ui->pushButton_2,SIGNAL(clicked(bool)),m_pSignalMapper,SLOT(map())); |
| 35 | 37 | ||
| 36 | connect(m_pSignalMapper,SIGNAL(mapped(int)),this,SLOT(onConfigBtnClicked(int))); | 38 | connect(m_pSignalMapper,SIGNAL(mapped(int)),this,SLOT(onConfigBtnClicked(int))); |
| 39 | + | ||
| 40 | + m_vectorTabOrder.append(this); m_vectorTabOrder.append(ui->pushButton_1); | ||
| 41 | + m_vectorTabOrder.append(ui->pushButton_2); | ||
| 42 | + m_vectorTabOrder.append(ui->ctrBtnOk); | ||
| 43 | + m_vectorTabOrder.append(ui->ctrBtnCancel); | ||
| 37 | } | 44 | } |
| 38 | 45 | ||
| 39 | ConfigDutyWashDlg::~ConfigDutyWashDlg() | 46 | ConfigDutyWashDlg::~ConfigDutyWashDlg() |
| @@ -60,6 +67,105 @@ void ConfigDutyWashDlg::onConfigBtnClicked(const int sel){ | @@ -60,6 +67,105 @@ void ConfigDutyWashDlg::onConfigBtnClicked(const int sel){ | ||
| 60 | m_nCurSel = sel; | 67 | m_nCurSel = sel; |
| 61 | } | 68 | } |
| 62 | 69 | ||
| 70 | +void ConfigDutyWashDlg::keyReleaseEvent(QKeyEvent *event) | ||
| 71 | +{ | ||
| 72 | + int i = 0; | ||
| 73 | + switch (event->key()) | ||
| 74 | + { | ||
| 75 | + case 0x01000030: // Turn left | ||
| 76 | + for(i = 0; i < m_vectorTabOrder.size();i++){ | ||
| 77 | + if(focusWidget() == m_vectorTabOrder[i]) break; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + if(i==0){ | ||
| 81 | + i = m_vectorTabOrder.size()-1; | ||
| 82 | + m_vectorTabOrder[i]->setFocus(); | ||
| 83 | + } | ||
| 84 | + else if(i < m_vectorTabOrder.size()) { | ||
| 85 | + i = i - 1; | ||
| 86 | + m_vectorTabOrder[i]->setFocus(); | ||
| 87 | + } | ||
| 88 | + else{ | ||
| 89 | + i=0; | ||
| 90 | + m_vectorTabOrder[i]->setFocus(); | ||
| 91 | + } | ||
| 92 | + break; | ||
| 93 | + case 0x01000031: // Push | ||
| 94 | + { | ||
| 95 | + QPushButton *btn = qobject_cast<QPushButton*>(focusWidget()); | ||
| 96 | + if(btn != NULL){ | ||
| 97 | + btn->click(); | ||
| 98 | + } | ||
| 99 | + break; | ||
| 100 | + } | ||
| 101 | + case 0x01000032: // Turn right | ||
| 102 | + for(i = 0; i < m_vectorTabOrder.size();i++){ | ||
| 103 | + if(focusWidget() == m_vectorTabOrder[i]) break; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + if(i<m_vectorTabOrder.size()-1){ | ||
| 107 | + i+=1; | ||
| 108 | + m_vectorTabOrder[i]->setFocus(); | ||
| 109 | + } | ||
| 110 | + else if(i== (m_vectorTabOrder.size()-1)){ | ||
| 111 | + i=0; | ||
| 112 | + m_vectorTabOrder[i]->setFocus(); | ||
| 113 | + } | ||
| 114 | + else{ | ||
| 115 | + i=0; | ||
| 116 | + m_vectorTabOrder[i]->setFocus(); | ||
| 117 | + } | ||
| 118 | + break; | ||
| 119 | + } | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | +void ConfigDutyWashDlg::keyPressEvent(QKeyEvent *event) | ||
| 123 | +{ | ||
| 124 | + int i = 0; | ||
| 125 | + switch (event->key()) | ||
| 126 | + { | ||
| 127 | + case 0x01000030: // Turn left | ||
| 128 | + for(i = 0; i < m_vectorTabOrder.size();i++){ | ||
| 129 | + if(focusWidget() == m_vectorTabOrder[i]) break; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + if(i==0){ | ||
| 133 | + i = m_vectorTabOrder.size()-1; | ||
| 134 | + m_vectorTabOrder[i]->setFocus(); | ||
| 135 | + } | ||
| 136 | + else if(i < m_vectorTabOrder.size()) { | ||
| 137 | + i = i - 1; | ||
| 138 | + m_vectorTabOrder[i]->setFocus(); | ||
| 139 | + } | ||
| 140 | + else{ | ||
| 141 | + i=0; | ||
| 142 | + m_vectorTabOrder[i]->setFocus(); | ||
| 143 | + } | ||
| 144 | + break; | ||
| 145 | + case 0x01000031: // Push | ||
| 146 | + | ||
| 147 | + break; | ||
| 148 | + case 0x01000032: // Turn right | ||
| 149 | + for(i = 0; i < m_vectorTabOrder.size();i++){ | ||
| 150 | + if(focusWidget() == m_vectorTabOrder[i]) break; | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + if(i<m_vectorTabOrder.size()-1){ | ||
| 154 | + i+=1; | ||
| 155 | + m_vectorTabOrder[i]->setFocus(); | ||
| 156 | + } | ||
| 157 | + else if(i== (m_vectorTabOrder.size()-1)){ | ||
| 158 | + i=0; | ||
| 159 | + m_vectorTabOrder[i]->setFocus(); | ||
| 160 | + } | ||
| 161 | + else{ | ||
| 162 | + i=0; | ||
| 163 | + m_vectorTabOrder[i]->setFocus(); | ||
| 164 | + } | ||
| 165 | + break; | ||
| 166 | + } | ||
| 167 | +} | ||
| 168 | + | ||
| 63 | void ConfigDutyWashDlg::reloadUi(){ | 169 | void ConfigDutyWashDlg::reloadUi(){ |
| 64 | switch(m_nCurSel){ | 170 | switch(m_nCurSel){ |
| 65 | case 0: | 171 | case 0: |
app/gui/oven_control/configdutywashdlg.h
| @@ -3,6 +3,8 @@ | @@ -3,6 +3,8 @@ | ||
| 3 | 3 | ||
| 4 | #include <QDialog> | 4 | #include <QDialog> |
| 5 | #include <QSignalMapper> | 5 | #include <QSignalMapper> |
| 6 | +#include <QVector> | ||
| 7 | +#include <QKeyEvent> | ||
| 6 | 8 | ||
| 7 | namespace Ui { | 9 | namespace Ui { |
| 8 | class ConfigDutyWashDlg; | 10 | class ConfigDutyWashDlg; |
| @@ -25,10 +27,15 @@ private slots: | @@ -25,10 +27,15 @@ private slots: | ||
| 25 | 27 | ||
| 26 | void onConfigBtnClicked(const int sel); | 28 | void onConfigBtnClicked(const int sel); |
| 27 | 29 | ||
| 30 | +protected: | ||
| 31 | + void keyReleaseEvent(QKeyEvent* event); | ||
| 32 | + void keyPressEvent(QKeyEvent* event); | ||
| 33 | + | ||
| 28 | private: | 34 | private: |
| 29 | Ui::ConfigDutyWashDlg *ui; | 35 | Ui::ConfigDutyWashDlg *ui; |
| 30 | QSignalMapper *m_pSignalMapper; | 36 | QSignalMapper *m_pSignalMapper; |
| 31 | int m_nCurSel; | 37 | int m_nCurSel; |
| 38 | + QVector<QWidget*> m_vectorTabOrder; | ||
| 32 | }; | 39 | }; |
| 33 | 40 | ||
| 34 | #endif // CONFIGDUTYWASHDLG_H | 41 | #endif // CONFIGDUTYWASHDLG_H |
app/gui/oven_control/configfileprocessdlg.ui
| @@ -83,7 +83,7 @@ QPushButton::pressed, QPushButton::focus{ | @@ -83,7 +83,7 @@ QPushButton::pressed, QPushButton::focus{ | ||
| 83 | border-image : url(:/images/config/105_icon_cancel.png); | 83 | border-image : url(:/images/config/105_icon_cancel.png); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | -QPushButton::pressed{ | 86 | +QPushButton::pressed, QPushButton::focus{ |
| 87 | border-image : url(:/images/config/105_icon_cancel_ov.png); | 87 | border-image : url(:/images/config/105_icon_cancel_ov.png); |
| 88 | } | 88 | } |
| 89 | </string> | 89 | </string> |
app/gui/oven_control/configinfodlg.cpp
| @@ -13,6 +13,8 @@ ConfigInfoDlg::ConfigInfoDlg(QWidget *parent, ConfigType type) : | @@ -13,6 +13,8 @@ ConfigInfoDlg::ConfigInfoDlg(QWidget *parent, ConfigType type) : | ||
| 13 | ui->setupUi(this); | 13 | ui->setupUi(this); |
| 14 | this->setWindowFlags( Qt::FramelessWindowHint); | 14 | this->setWindowFlags( Qt::FramelessWindowHint); |
| 15 | this->setAttribute( Qt::WA_DeleteOnClose); | 15 | this->setAttribute( Qt::WA_DeleteOnClose); |
| 16 | + qApp->setActiveWindow(this); | ||
| 17 | + this->setFocus(); | ||
| 16 | 18 | ||
| 17 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 19 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 18 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 20 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| @@ -33,6 +35,7 @@ ConfigInfoDlg::ConfigInfoDlg(QWidget *parent, ConfigType type) : | @@ -33,6 +35,7 @@ ConfigInfoDlg::ConfigInfoDlg(QWidget *parent, ConfigType type) : | ||
| 33 | loadSoftwareInfo(); | 35 | loadSoftwareInfo(); |
| 34 | break; | 36 | break; |
| 35 | } | 37 | } |
| 38 | + ui->ctrBtnOk->setFocus(); | ||
| 36 | } | 39 | } |
| 37 | 40 | ||
| 38 | ConfigInfoDlg::~ConfigInfoDlg() | 41 | ConfigInfoDlg::~ConfigInfoDlg() |
| @@ -129,3 +132,21 @@ void ConfigInfoDlg::loadHotlineServiceInfo(){ | @@ -129,3 +132,21 @@ void ConfigInfoDlg::loadHotlineServiceInfo(){ | ||
| 129 | ui->gridLayout_info->addWidget(label,i,1); | 132 | ui->gridLayout_info->addWidget(label,i,1); |
| 130 | } | 133 | } |
| 131 | } | 134 | } |
| 135 | + | ||
| 136 | +void ConfigInfoDlg::keyPressEvent(QKeyEvent *event){ | ||
| 137 | + | ||
| 138 | +} | ||
| 139 | + | ||
| 140 | +void ConfigInfoDlg::keyReleaseEvent(QKeyEvent *event){ | ||
| 141 | + switch (event->key()) | ||
| 142 | + { | ||
| 143 | + case 0x01000031: // Push | ||
| 144 | + { | ||
| 145 | + QPushButton *btn = qobject_cast<QPushButton*>(focusWidget()); | ||
| 146 | + if(btn != NULL){ | ||
| 147 | + btn->click(); | ||
| 148 | + } | ||
| 149 | + break; | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | +} |
app/gui/oven_control/configinfodlg.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define CONFIGINFODLG_H | 2 | #define CONFIGINFODLG_H |
| 3 | 3 | ||
| 4 | #include <QDialog> | 4 | #include <QDialog> |
| 5 | +#include <QKeyEvent> | ||
| 5 | #include "config.h" | 6 | #include "config.h" |
| 6 | 7 | ||
| 7 | 8 | ||
| @@ -26,6 +27,10 @@ public: | @@ -26,6 +27,10 @@ public: | ||
| 26 | private slots: | 27 | private slots: |
| 27 | void on_ctrBtnOk_clicked(); | 28 | void on_ctrBtnOk_clicked(); |
| 28 | 29 | ||
| 30 | +protected: | ||
| 31 | + void keyReleaseEvent(QKeyEvent* event); | ||
| 32 | + void keyPressEvent(QKeyEvent* event); | ||
| 33 | + | ||
| 29 | private: | 34 | private: |
| 30 | Ui::ConfigInfoDlg *ui; | 35 | Ui::ConfigInfoDlg *ui; |
| 31 | ConfigType m_nType; | 36 | ConfigType m_nType; |
app/gui/oven_control/engineermenuwindow.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define ENGINEERMENUWINDOW_H | 2 | #define ENGINEERMENUWINDOW_H |
| 3 | 3 | ||
| 4 | #include <QMainWindow> | 4 | #include <QMainWindow> |
| 5 | +#include <QKeyEvent> | ||
| 5 | 6 | ||
| 6 | namespace Ui { | 7 | namespace Ui { |
| 7 | class EngineerMenuWindow; | 8 | class EngineerMenuWindow; |
| @@ -34,6 +35,10 @@ private slots: | @@ -34,6 +35,10 @@ private slots: | ||
| 34 | 35 | ||
| 35 | void on_modelTypeConfigButton_clicked(); | 36 | void on_modelTypeConfigButton_clicked(); |
| 36 | 37 | ||
| 38 | +protected: | ||
| 39 | + void keyReleaseEvent(QKeyEvent* event); | ||
| 40 | + void keyPressEvent(QKeyEvent* event); | ||
| 41 | + | ||
| 37 | private: | 42 | private: |
| 38 | Ui::EngineerMenuWindow *ui; | 43 | Ui::EngineerMenuWindow *ui; |
| 39 | 44 |
app/gui/oven_control/functiontestwindow.cpp
| @@ -118,3 +118,35 @@ void FunctionTestWindow::onEncoderClicked(QWidget *clicked) | @@ -118,3 +118,35 @@ void FunctionTestWindow::onEncoderClicked(QWidget *clicked) | ||
| 118 | if (b) | 118 | if (b) |
| 119 | b->click(); | 119 | b->click(); |
| 120 | } | 120 | } |
| 121 | + | ||
| 122 | +void FunctionTestWindow::keyPressEvent(QKeyEvent *event){ | ||
| 123 | + switch (event->key()) | ||
| 124 | + { | ||
| 125 | + case 0x01000030: // Turn left | ||
| 126 | + focusPreviousChild(); | ||
| 127 | + break; | ||
| 128 | + case 0x01000032: // Turn right | ||
| 129 | + focusNextChild(); | ||
| 130 | + break; | ||
| 131 | + } | ||
| 132 | +} | ||
| 133 | + | ||
| 134 | +void FunctionTestWindow::keyReleaseEvent(QKeyEvent *event){ | ||
| 135 | + switch (event->key()) | ||
| 136 | + { | ||
| 137 | + case 0x01000030: // Turn left | ||
| 138 | + focusPreviousChild(); | ||
| 139 | + break; | ||
| 140 | + case 0x01000031: // Push | ||
| 141 | + { | ||
| 142 | + QPushButton *btn = qobject_cast<QPushButton*>(focusWidget()); | ||
| 143 | + if(btn != NULL){ | ||
| 144 | + btn->click(); | ||
| 145 | + } | ||
| 146 | + break; | ||
| 147 | + } | ||
| 148 | + case 0x01000032: // Turn right | ||
| 149 | + focusNextChild(); | ||
| 150 | + break; | ||
| 151 | + } | ||
| 152 | +} |
app/gui/oven_control/functiontestwindow.h
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | #define FUNCTIONTESTWINDOW_H | 2 | #define FUNCTIONTESTWINDOW_H |
| 3 | 3 | ||
| 4 | #include <QMainWindow> | 4 | #include <QMainWindow> |
| 5 | +#include <QKeyEvent> | ||
| 5 | 6 | ||
| 6 | namespace Ui { | 7 | namespace Ui { |
| 7 | class FunctionTestWindow; | 8 | class FunctionTestWindow; |
| @@ -32,6 +33,10 @@ private slots: | @@ -32,6 +33,10 @@ private slots: | ||
| 32 | 33 | ||
| 33 | void on_gasTestButton_clicked(); | 34 | void on_gasTestButton_clicked(); |
| 34 | 35 | ||
| 36 | +protected: | ||
| 37 | + void keyReleaseEvent(QKeyEvent* event); | ||
| 38 | + void keyPressEvent(QKeyEvent* event); | ||
| 39 | + | ||
| 35 | private: | 40 | private: |
| 36 | Ui::FunctionTestWindow *ui; | 41 | Ui::FunctionTestWindow *ui; |
| 37 | 42 |
app/gui/oven_control/usbcheckpopupdlg.ui
| @@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
| 55 | border : none; | 55 | border : none; |
| 56 | color : white; | 56 | color : white; |
| 57 | } | 57 | } |
| 58 | -QPushButton::pressed {color : yellow}</string> | 58 | +QPushButton::pressed, QPushButton:focus {color : yellow}</string> |
| 59 | </property> | 59 | </property> |
| 60 | <property name="text"> | 60 | <property name="text"> |
| 61 | <string>확인</string> | 61 | <string>확인</string> |