From be7d2a6253b452fa29e07a25477adffc666a55c7 Mon Sep 17 00:00:00 2001 From: byloveletter Date: Wed, 14 Jun 2017 16:13:04 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=94=EC=BD=94=EB=8D=94=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 키보드 기능 엔코더 구현(focusInKeyboard API 사용) - 날짜와 시간 적용 --- app/gui/oven_control/configdatetimedlg.cpp | 91 ++++++++ app/gui/oven_control/configdatetimedlg.h | 14 ++ app/gui/oven_control/configdatetimedlg.ui | 9 + .../oven_control/electricmodelsettingwindow.cpp | 160 +++++++++----- app/gui/oven_control/electricmodelsettingwindow.h | 9 +- app/gui/oven_control/electricmodelsettingwindow.ui | 8 +- app/gui/oven_control/formatterspinbox.cpp | 12 +- app/gui/oven_control/formatterspinbox.h | 7 +- app/gui/oven_control/gasmodelsettingwindow.cpp | 184 +++++++++------- app/gui/oven_control/gasmodelsettingwindow.h | 8 +- app/gui/oven_control/gasmodelsettingwindow.ui | 16 +- app/gui/oven_control/keyboardwidget.cpp | 245 +++++++++++++++++---- app/gui/oven_control/keyboardwidget.h | 16 +- app/gui/oven_control/keyboardwidget.ui | 221 +++++++++++++++---- 14 files changed, 743 insertions(+), 257 deletions(-) diff --git a/app/gui/oven_control/configdatetimedlg.cpp b/app/gui/oven_control/configdatetimedlg.cpp index 18e7072..5be5813 100644 --- a/app/gui/oven_control/configdatetimedlg.cpp +++ b/app/gui/oven_control/configdatetimedlg.cpp @@ -1,4 +1,5 @@ #include +#include #include "configdatetimedlg.h" #include "ui_configdatetimedlg.h" #include "system.h" @@ -12,6 +13,8 @@ ConfigDateTimeDlg::ConfigDateTimeDlg(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); @@ -25,6 +28,28 @@ ConfigDateTimeDlg::ConfigDateTimeDlg(QWidget *parent) : ui->ctrSpBxDay->setValue(dt_.day()); ui->ctrSpBxHour->setValue(tm_.hour()); ui->ctrSpBxMin->setValue(tm_.minute()); + + ui->ctrSpBxYear->setFocus(); + m_bInputState = true; + + + connect(ui->keyboardwidget, SIGNAL(onOkKeyClicked()), this, SLOT(on_keyEnter_clicked())); + connect(ui->keyboardwidget, SIGNAL(onCancelKeyClicked()), this, SLOT(on_keyCancel_clicked())); + + m_pMapperSpins = new QSignalMapper(this); + m_pMapperSpins->setMapping(ui->ctrSpBxYear, ui->ctrSpBxYear); + m_pMapperSpins->setMapping(ui->ctrSpBxMonth, ui->ctrSpBxMonth); + m_pMapperSpins->setMapping(ui->ctrSpBxDay, ui->ctrSpBxDay); + m_pMapperSpins->setMapping(ui->ctrSpBxHour, ui->ctrSpBxHour); + m_pMapperSpins->setMapping(ui->ctrSpBxMin, ui->ctrSpBxMin); + + connect(ui->ctrSpBxYear, SIGNAL(focusInEdit()), m_pMapperSpins, SLOT(map())); + connect(ui->ctrSpBxMonth, SIGNAL(focusInEdit()), m_pMapperSpins, SLOT(map())); + connect(ui->ctrSpBxDay, SIGNAL(focusInEdit()), m_pMapperSpins, SLOT(map())); + connect(ui->ctrSpBxHour, SIGNAL(focusInEdit()), m_pMapperSpins, SLOT(map())); + connect(ui->ctrSpBxMin, SIGNAL(focusInEdit()), m_pMapperSpins, SLOT(map())); + + connect(m_pMapperSpins, SIGNAL(mapped(QWidget*)), this, SLOT(on_focusInSpinBox(QWidget*))); } ConfigDateTimeDlg::~ConfigDateTimeDlg() @@ -55,3 +80,69 @@ void ConfigDateTimeDlg::on_ctrBtnCancel_clicked() { this->reject(); } + +void ConfigDateTimeDlg::keyPressEvent(QKeyEvent *event){ + int i = 0; + switch (event->key()) + { + case 0x01000030: // Turn left + if(focusWidget() == ui->ctrSpBxYear) ui->ctrBtnCancel->setFocus(); + else focusPreviousChild(); + break; + case 0x01000031: // Push + + break; + case 0x01000032: // Turn right + if(focusWidget() == ui->ctrBtnCancel) ui->ctrSpBxYear->setFocus(); + else focusNextChild(); + + break; + } +} + +void ConfigDateTimeDlg::keyReleaseEvent(QKeyEvent *event){ + int i = 0; + switch (event->key()) + { + case 0x01000030: // Turn left + if(focusWidget() == ui->ctrSpBxYear) ui->ctrBtnCancel->setFocus(); + else focusPreviousChild(); + break; + case 0x01000031: // Push + { + QPushButton *btn = qobject_cast(focusWidget()); + if(btn != NULL){ + btn->click(); + } + else{ + QSpinBox *spbx = qobject_cast(focusWidget()); + qDebug() << "grab keyboard"; + if(spbx != NULL) ui->keyboardwidget->focusInKeyboard(); + } + break; + } + case 0x01000032: // Turn right + if(focusWidget() == ui->ctrBtnCancel) ui->ctrSpBxYear->setFocus(); + else focusNextChild(); + break; + } +} + +void ConfigDateTimeDlg::on_keyCancel_clicked(){ + QSpinBox *spbx = qobject_cast(focusWidget()); + if(spbx != NULL){ + spbx->setValue(m_nFocusValue); + } + ui->keyboardwidget->focusOutKeyboard(); +} + +void ConfigDateTimeDlg::on_keyEnter_clicked(){ + ui->keyboardwidget->focusOutKeyboard(); +} + +void ConfigDateTimeDlg::on_focusInSpinBox(QWidget *widget){ + QSpinBox *spbx = qobject_cast(widget); + if(spbx != NULL){ + m_nFocusValue = spbx->value(); + } +} diff --git a/app/gui/oven_control/configdatetimedlg.h b/app/gui/oven_control/configdatetimedlg.h index 8aa2d9a..0d6f38d 100644 --- a/app/gui/oven_control/configdatetimedlg.h +++ b/app/gui/oven_control/configdatetimedlg.h @@ -2,6 +2,7 @@ #define CONFIGDATETIMEDLG_H #include +#include namespace Ui { @@ -24,8 +25,21 @@ private slots: void on_ctrBtnCancel_clicked(); + void on_keyCancel_clicked(); + void on_keyEnter_clicked(); + + void on_focusInSpinBox(QWidget* widget); + +protected: + void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event); + + private: Ui::ConfigDateTimeDlg *ui; + bool m_bInputState; + QSignalMapper* m_pMapperSpins; + int m_nFocusValue; }; #endif // CONFIGDATETIMEDLG_H diff --git a/app/gui/oven_control/configdatetimedlg.ui b/app/gui/oven_control/configdatetimedlg.ui index 996483a..a74402a 100644 --- a/app/gui/oven_control/configdatetimedlg.ui +++ b/app/gui/oven_control/configdatetimedlg.ui @@ -483,6 +483,15 @@ QPushButton::pressed, QPushButton::focus{
formatterspinbox.h
+ + ctrSpBxYear + ctrSpBxMonth + ctrSpBxDay + ctrSpBxHour + ctrSpBxMin + ctrBtnOk + ctrBtnCancel + diff --git a/app/gui/oven_control/electricmodelsettingwindow.cpp b/app/gui/oven_control/electricmodelsettingwindow.cpp index e5bb152..a6bb6ca 100644 --- a/app/gui/oven_control/electricmodelsettingwindow.cpp +++ b/app/gui/oven_control/electricmodelsettingwindow.cpp @@ -13,6 +13,8 @@ ElectricModelSettingWindow::ElectricModelSettingWindow(QWidget *parent) : ui->clockContainer->setParent(ui->upperStack); setAttribute(Qt::WA_DeleteOnClose); + + foreach (QPushButton *button, findChildren()) connect(button, &QPushButton::pressed, SoundPlayer::playClick); @@ -20,26 +22,27 @@ ElectricModelSettingWindow::ElectricModelSettingWindow(QWidget *parent) : Define::config_item item; item = cfg->getConfigValue(Define::config_model); selitem = item.d32; - m_ctrChkedbtn = NULL; switch(selitem){ case Define::model_electric_10: ui->e10Button->setChecked(true); - m_ctrChkedbtn = ui->e10Button; break; case Define::model_electric_20: ui->e20Button->setChecked(true); - m_ctrChkedbtn = ui->e20Button; break; case Define::model_electric_24: ui->e24Button->setChecked(true); - m_ctrChkedbtn = ui->e24Button; break; case Define::model_electric_40: ui->e40Button->setChecked(true); - m_ctrChkedbtn = ui->e40Button; break; } this->setFocus(); + m_vectorTabOrder.append(this); + m_vectorTabOrder.append(ui->e10Button); + m_vectorTabOrder.append(ui->e20Button); + m_vectorTabOrder.append(ui->e24Button); + m_vectorTabOrder.append(ui->e40Button); + m_vectorTabOrder.append(ui->backButton); } ElectricModelSettingWindow::~ElectricModelSettingWindow() @@ -47,41 +50,6 @@ ElectricModelSettingWindow::~ElectricModelSettingWindow() delete ui; } -void ElectricModelSettingWindow::keyPressEvent(QKeyEvent *event) -{ - switch (event->key()) - { - case 0x01000030: // Turn left - onEncoderLeft(); - break; - case 0x01000031: // Push - pushed = focusWidget(); - break; - case 0x01000032: // Turn right - onEncoderRight(); - break; - } -} - -void ElectricModelSettingWindow::keyReleaseEvent(QKeyEvent *event) -{ - switch (event->key()) - { - case 0x01000030: // Turn left - onEncoderLeft(); - break; - case 0x01000031: // Push - if (focusWidget() == pushed) - onEncoderClicked(pushed); - - pushed = NULL; - break; - case 0x01000032: // Turn right - onEncoderRight(); - break; - } -} - void ElectricModelSettingWindow::setModel(Define::model_type model) { Define::config_item item; @@ -95,24 +63,18 @@ void ElectricModelSettingWindow::setModel(Define::model_type model) void ElectricModelSettingWindow::on_e10Button_clicked() { //setModel(Define::model_electric_10); - if(m_ctrChkedbtn != NULL) m_ctrChkedbtn->setChecked(false); - m_ctrChkedbtn = ui->e10Button; selitem = Define::model_electric_10; } void ElectricModelSettingWindow::on_e20Button_clicked() { //setModel(Define::model_electric_20); - if(m_ctrChkedbtn != NULL) m_ctrChkedbtn->setChecked(false); - m_ctrChkedbtn = ui->e20Button; selitem = Define::model_electric_20; } void ElectricModelSettingWindow::on_e24Button_clicked() { //setModel(Define::model_electric_24); - if(m_ctrChkedbtn != NULL) m_ctrChkedbtn->setChecked(false); - m_ctrChkedbtn = ui->e24Button; selitem = Define::model_electric_24; @@ -121,8 +83,6 @@ void ElectricModelSettingWindow::on_e24Button_clicked() void ElectricModelSettingWindow::on_e40Button_clicked() { //setModel(Define::model_electric_40); - if(m_ctrChkedbtn != NULL) m_ctrChkedbtn->setChecked(false); - m_ctrChkedbtn = ui->e40Button; selitem = Define::model_electric_40; } @@ -144,19 +104,99 @@ void ElectricModelSettingWindow::on_backButton_clicked() close(); } -void ElectricModelSettingWindow::onEncoderLeft() -{ - focusPreviousChild(); -} +void ElectricModelSettingWindow::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; + } -void ElectricModelSettingWindow::onEncoderRight() -{ - focusNextChild(); + 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 ElectricModelSettingWindow::onEncoderClicked(QWidget *clicked) -{ - QPushButton *b = qobject_cast(clicked); - if (b) - b->click(); +void ElectricModelSettingWindow::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; + } } diff --git a/app/gui/oven_control/electricmodelsettingwindow.h b/app/gui/oven_control/electricmodelsettingwindow.h index ffe1b36..3d0cb55 100644 --- a/app/gui/oven_control/electricmodelsettingwindow.h +++ b/app/gui/oven_control/electricmodelsettingwindow.h @@ -3,6 +3,8 @@ #include #include +#include +#include #include "config.h" @@ -37,12 +39,7 @@ private: int selitem; QWidget *pushed = NULL; - - void onEncoderLeft(); - void onEncoderRight(); - void onEncoderClicked(QWidget *clicked); - - QPushButton *m_ctrChkedbtn; + QVector m_vectorTabOrder; }; #endif // ELECTRICMODELSETTINGWINDOW_H diff --git a/app/gui/oven_control/electricmodelsettingwindow.ui b/app/gui/oven_control/electricmodelsettingwindow.ui index 83ee36e..6ac9fe3 100644 --- a/app/gui/oven_control/electricmodelsettingwindow.ui +++ b/app/gui/oven_control/electricmodelsettingwindow.ui @@ -49,7 +49,7 @@ QPushButton:pressed, QPushButton:checked, QPushButton:focus { border-image: url( true - false + true @@ -183,7 +183,7 @@ QPushButton:pressed, QPushButton:checked, QPushButton:focus { border-image: url( true - false + true @@ -396,7 +396,7 @@ QPushButton:pressed, QPushButton:checked, QPushButton:focus { border-image: url( true - false + true @@ -433,7 +433,7 @@ QPushButton:pressed, QPushButton:checked, QPushButton:focus { border-image: url( true - false + true diff --git a/app/gui/oven_control/formatterspinbox.cpp b/app/gui/oven_control/formatterspinbox.cpp index cf707ed..967c819 100644 --- a/app/gui/oven_control/formatterspinbox.cpp +++ b/app/gui/oven_control/formatterspinbox.cpp @@ -7,7 +7,6 @@ FormatterSpinBox::FormatterSpinBox(QWidget *parent) : QSpinBox(parent) { m_nwidth = 2; - } //! [1] @@ -31,9 +30,14 @@ FormatterSpinBox::FormatterSpinBox(QWidget *parent) } void FormatterSpinBox::focusInEvent(QFocusEvent *event){ - QTimer::singleShot(200,this,SLOT(selectAll())); + qDebug() << "focus in"; + if(event->reason() == Qt::MouseFocusReason) QTimer::singleShot(200,this,SLOT(selectAll())); + else selectAll(); + emit focusInEdit(); } - void FormatterSpinBox::mouseReleaseEvent(QMouseEvent *event){ - this->selectAll(); + void FormatterSpinBox::focusOutEvent(QFocusEvent *event){ + QSpinBox::focusOutEvent(event); + emit focusOutEdit(); } + diff --git a/app/gui/oven_control/formatterspinbox.h b/app/gui/oven_control/formatterspinbox.h index ba632fe..480668c 100644 --- a/app/gui/oven_control/formatterspinbox.h +++ b/app/gui/oven_control/formatterspinbox.h @@ -12,6 +12,10 @@ class FormatterSpinBox : public QSpinBox private: int m_nwidth; +signals: + void focusInEdit(void); + void focusOutEdit(void); + public: explicit FormatterSpinBox(QWidget *parent = Q_NULLPTR); @@ -21,8 +25,7 @@ public: void setFormatterWidth(int wid); void focusInEvent(QFocusEvent *event); - - void mouseReleaseEvent(QMouseEvent *event); + void focusOutEvent(QFocusEvent *event); }; #endif // SPINBOX_H diff --git a/app/gui/oven_control/gasmodelsettingwindow.cpp b/app/gui/oven_control/gasmodelsettingwindow.cpp index edc7329..df0db15 100644 --- a/app/gui/oven_control/gasmodelsettingwindow.cpp +++ b/app/gui/oven_control/gasmodelsettingwindow.cpp @@ -21,82 +21,50 @@ GasModelSettingWindow::GasModelSettingWindow(QWidget *parent) : Define::config_item item; item = cfg->getConfigValue(Define::config_model); selitem = item.d32; - m_ctrChkedBtn = NULL; switch(item.d32){ case Define::model_gas_lng_10: ui->lng10Button->setChecked(true); - m_ctrChkedBtn = ui->lng10Button; break; case Define::model_gas_lng_20: ui->lng20Button->setChecked(true); - m_ctrChkedBtn = ui->lng20Button; break; case Define::model_gas_lng_24: ui->lng24Button->setChecked(true); - m_ctrChkedBtn = ui->lng24Button; break; case Define::model_gas_lng_40: ui->lng40Button->setChecked(true); - m_ctrChkedBtn = ui->lng40Button; break; case Define::model_gas_lpg_10: ui->lpg10Button->setChecked(true); - m_ctrChkedBtn = ui->lpg10Button; break; case Define::model_gas_lpg_20: ui->lpg20Button->setChecked(true); - m_ctrChkedBtn = ui->lpg20Button; break; case Define::model_gas_lpg_24: ui->lpg24Button->setChecked(true); - m_ctrChkedBtn = ui->lpg24Button; break; case Define::model_gas_lpg_40: ui->lpg40Button->setChecked(true); - m_ctrChkedBtn = ui->lpg40Button; break; } this->setFocus(); -} -GasModelSettingWindow::~GasModelSettingWindow() -{ - delete ui; -} + m_vectorTabOrder.append(this); + m_vectorTabOrder.append(ui->lpg10Button); + m_vectorTabOrder.append(ui->lng10Button); + m_vectorTabOrder.append(ui->lpg20Button); + m_vectorTabOrder.append(ui->lng20Button); + m_vectorTabOrder.append(ui->lpg24Button); + m_vectorTabOrder.append(ui->lng24Button); + m_vectorTabOrder.append(ui->lpg40Button); + m_vectorTabOrder.append(ui->lng40Button); + m_vectorTabOrder.append(ui->backButton); -void GasModelSettingWindow::keyPressEvent(QKeyEvent *event) -{ - switch (event->key()) - { - case 0x01000030: // Turn left - onEncoderLeft(); - break; - case 0x01000031: // Push - pushed = focusWidget(); - break; - case 0x01000032: // Turn right - onEncoderRight(); - break; - } } -void GasModelSettingWindow::keyReleaseEvent(QKeyEvent *event) +GasModelSettingWindow::~GasModelSettingWindow() { - switch (event->key()) - { - case 0x01000030: // Turn left - onEncoderLeft(); - break; - case 0x01000031: // Push - if (focusWidget() == pushed) - onEncoderClicked(pushed); - - pushed = NULL; - break; - case 0x01000032: // Turn right - onEncoderRight(); - break; - } + delete ui; } void GasModelSettingWindow::setModel(Define::model_type model) @@ -112,71 +80,48 @@ void GasModelSettingWindow::setModel(Define::model_type model) void GasModelSettingWindow::on_lpg10Button_clicked() { //setModel(Define::model_gas_lpg_10); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lpg10Button; selitem = Define::model_gas_lpg_10; } void GasModelSettingWindow::on_lng10Button_clicked() { //setModel(Define::model_gas_lng_10); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lng10Button; - selitem = Define::model_gas_lng_10; } void GasModelSettingWindow::on_lpg20Button_clicked() { //setModel(Define::model_gas_lpg_20); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lpg20Button; - selitem = Define::model_gas_lpg_20; } void GasModelSettingWindow::on_lng20Button_clicked() { //setModel(Define::model_gas_lng_20); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lng20Button; - selitem = Define::model_gas_lng_20; } void GasModelSettingWindow::on_lpg24Button_clicked() { //setModel(Define::model_gas_lpg_24); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lpg24Button; - selitem = Define::model_gas_lpg_24; } void GasModelSettingWindow::on_lng24Button_clicked() { //setModel(Define::model_gas_lng_24); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lng24Button; - selitem = Define::model_gas_lng_24; } void GasModelSettingWindow::on_lpg40Button_clicked() { //setModel(Define::model_gas_lpg_40); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lpg40Button; - selitem = Define::model_gas_lpg_40; } void GasModelSettingWindow::on_lng40Button_clicked() { //setModel(Define::model_gas_lng_40); - if(m_ctrChkedBtn != NULL)m_ctrChkedBtn->setChecked(false); - m_ctrChkedBtn = ui->lng40Button; - selitem = Define::model_gas_lng_40; } @@ -198,19 +143,100 @@ void GasModelSettingWindow::on_backButton_clicked() close(); } -void GasModelSettingWindow::onEncoderLeft() -{ - focusPreviousChild(); -} +void GasModelSettingWindow::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; + } -void GasModelSettingWindow::onEncoderRight() -{ - focusNextChild(); + 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 GasModelSettingWindow::onEncoderClicked(QWidget *clicked) -{ - QPushButton *b = qobject_cast(clicked); - if (b) - b->click(); +void GasModelSettingWindow::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; + } } + diff --git a/app/gui/oven_control/gasmodelsettingwindow.h b/app/gui/oven_control/gasmodelsettingwindow.h index a65e4d1..4c1b62d 100644 --- a/app/gui/oven_control/gasmodelsettingwindow.h +++ b/app/gui/oven_control/gasmodelsettingwindow.h @@ -3,6 +3,8 @@ #include #include +#include +#include #include "config.h" @@ -40,11 +42,7 @@ private: uint32_t selitem; QWidget *pushed = NULL; - - void onEncoderLeft(); - void onEncoderRight(); - void onEncoderClicked(QWidget *clicked); - QPushButton* m_ctrChkedBtn; + QVector m_vectorTabOrder; }; #endif // GASMODELSETTINGWINDOW_H diff --git a/app/gui/oven_control/gasmodelsettingwindow.ui b/app/gui/oven_control/gasmodelsettingwindow.ui index 7914e37..cb667bd 100644 --- a/app/gui/oven_control/gasmodelsettingwindow.ui +++ b/app/gui/oven_control/gasmodelsettingwindow.ui @@ -49,7 +49,7 @@ QPushButton:pressed, QPushButton::checked , QPushButton:focus{ border-image: url true - false + true @@ -196,7 +196,7 @@ QPushButton:pressed, QPushButton::checked, QPushButton:focus { border-image: url true - false + true @@ -233,7 +233,7 @@ QPushButton:pressed , QPushButton::checked, QPushButton:focus { border-image: ur true - false + true @@ -270,7 +270,7 @@ QPushButton:pressed, QPushButton::checked, QPushButton:focus { border-image: url true - false + true @@ -496,7 +496,7 @@ QPushButton:pressed, QPushButton::checked, QPushButton:focus{ border-image: url( true - false + true @@ -533,7 +533,7 @@ QPushButton:pressed , QPushButton::checked, QPushButton:focus{ border-image: url true - false + true @@ -619,7 +619,7 @@ QPushButton:pressed,QPushButton::checked, QPushButton:focus { border-image: url( true - false + true @@ -682,7 +682,7 @@ QPushButton:pressed, QPushButton::checked, QPushButton:focus { border-image: url true - false + true diff --git a/app/gui/oven_control/keyboardwidget.cpp b/app/gui/oven_control/keyboardwidget.cpp index f12df47..2d7dbe1 100644 --- a/app/gui/oven_control/keyboardwidget.cpp +++ b/app/gui/oven_control/keyboardwidget.cpp @@ -5,52 +5,145 @@ #include "soundplayer.h" +static const QString m_mapKeyboard[] = { + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "0", + "Q", + "W", + "E", + "R", + "T", + "Y", + "U", + "I", + "O", + "P", + "A", + "S", + "D", + "F", + "G", + "H", + "J", + "K", + "L", + "Z", + "X", + "C", + "V", + "B", + "N", + "M", + "-", + ",", + " " +}; + + + KeyboardWidget::KeyboardWidget(QWidget *parent) : QWidget(parent), ui(new Ui::KeyboardWidget) { ui->setupUi(this); + + m_pCurCheckedBtn = NULL; + m_vectorTabOrder.append(ui->pushButton_1); + m_vectorTabOrder.append(ui->pushButton_2); + m_vectorTabOrder.append(ui->pushButton_3); + m_vectorTabOrder.append(ui->pushButton_4); + m_vectorTabOrder.append(ui->pushButton_5); + m_vectorTabOrder.append(ui->pushButton_6); + m_vectorTabOrder.append(ui->pushButton_7); + m_vectorTabOrder.append(ui->pushButton_8); + m_vectorTabOrder.append(ui->pushButton_9); + m_vectorTabOrder.append(ui->pushButton_10); + m_vectorTabOrder.append(ui->pushButton_11); + m_vectorTabOrder.append(ui->pushButton_12); + m_vectorTabOrder.append(ui->pushButton_13); + m_vectorTabOrder.append(ui->pushButton_14); + m_vectorTabOrder.append(ui->pushButton_15); + m_vectorTabOrder.append(ui->pushButton_16); + m_vectorTabOrder.append(ui->pushButton_17); + m_vectorTabOrder.append(ui->pushButton_18); + m_vectorTabOrder.append(ui->pushButton_19); + m_vectorTabOrder.append(ui->pushButton_20); + m_vectorTabOrder.append(ui->pushButton_21); + m_vectorTabOrder.append(ui->pushButton_22); + m_vectorTabOrder.append(ui->pushButton_23); + m_vectorTabOrder.append(ui->pushButton_24); + m_vectorTabOrder.append(ui->pushButton_25); + m_vectorTabOrder.append(ui->pushButton_26); + m_vectorTabOrder.append(ui->pushButton_27); + m_vectorTabOrder.append(ui->pushButton_28); + m_vectorTabOrder.append(ui->pushButton_29); + m_vectorTabOrder.append(ui->pushButton_30); + m_vectorTabOrder.append(ui->pushButton_31); + m_vectorTabOrder.append(ui->pushButton_32); + m_vectorTabOrder.append(ui->pushButton_33); + m_vectorTabOrder.append(ui->pushButton_34); + m_vectorTabOrder.append(ui->pushButton_35); + m_vectorTabOrder.append(ui->pushButton_36); + m_vectorTabOrder.append(ui->pushButton_37); + m_vectorTabOrder.append(ui->pushButton_38); + m_vectorTabOrder.append(ui->pushButton_39); + m_vectorTabOrder.append(ui->pushButton_40); + m_vectorTabOrder.append(ui->pushButton_41); + m_vectorTabOrder.append(ui->pushButton_42); + + + m_pSignalMapper = new QSignalMapper(this); - m_pSignalMapper->setMapping(ui->pushButton_1, tr("1")); - m_pSignalMapper->setMapping(ui->pushButton_2, tr("2")); - m_pSignalMapper->setMapping(ui->pushButton_3, tr("3")); - m_pSignalMapper->setMapping(ui->pushButton_4, tr("4")); - m_pSignalMapper->setMapping(ui->pushButton_5, tr("5")); - m_pSignalMapper->setMapping(ui->pushButton_6, tr("6")); - m_pSignalMapper->setMapping(ui->pushButton_7, tr("7")); - m_pSignalMapper->setMapping(ui->pushButton_8, tr("8")); - m_pSignalMapper->setMapping(ui->pushButton_9, tr("9")); - m_pSignalMapper->setMapping(ui->pushButton_10, tr("0")); - m_pSignalMapper->setMapping(ui->pushButton_11, tr("Q")); - m_pSignalMapper->setMapping(ui->pushButton_12, tr("W")); - m_pSignalMapper->setMapping(ui->pushButton_13, tr("E")); - m_pSignalMapper->setMapping(ui->pushButton_14, tr("R")); - m_pSignalMapper->setMapping(ui->pushButton_15, tr("T")); - m_pSignalMapper->setMapping(ui->pushButton_16, tr("Y")); - m_pSignalMapper->setMapping(ui->pushButton_17, tr("U")); - m_pSignalMapper->setMapping(ui->pushButton_18, tr("I")); - m_pSignalMapper->setMapping(ui->pushButton_19, tr("O")); - m_pSignalMapper->setMapping(ui->pushButton_20, tr("P")); - m_pSignalMapper->setMapping(ui->pushButton_21, tr("A")); - m_pSignalMapper->setMapping(ui->pushButton_22, tr("S")); - m_pSignalMapper->setMapping(ui->pushButton_23, tr("D")); - m_pSignalMapper->setMapping(ui->pushButton_24, tr("F")); - m_pSignalMapper->setMapping(ui->pushButton_25, tr("G")); - m_pSignalMapper->setMapping(ui->pushButton_26, tr("H")); - m_pSignalMapper->setMapping(ui->pushButton_27, tr("J")); - m_pSignalMapper->setMapping(ui->pushButton_28, tr("K")); - m_pSignalMapper->setMapping(ui->pushButton_29, tr("L")); - m_pSignalMapper->setMapping(ui->pushButton_30, tr("Z")); - m_pSignalMapper->setMapping(ui->pushButton_31, tr("X")); - m_pSignalMapper->setMapping(ui->pushButton_32, tr("C")); - m_pSignalMapper->setMapping(ui->pushButton_33, tr("V")); - m_pSignalMapper->setMapping(ui->pushButton_34, tr("B")); - m_pSignalMapper->setMapping(ui->pushButton_35, tr("N")); - m_pSignalMapper->setMapping(ui->pushButton_36, tr("M")); - m_pSignalMapper->setMapping(ui->pushButton_37, tr("-")); - m_pSignalMapper->setMapping(ui->pushButton_38, tr(",")); - m_pSignalMapper->setMapping(ui->pushButton_40, tr(" ")); + m_pSignalMapper->setMapping(ui->pushButton_1, 0); + m_pSignalMapper->setMapping(ui->pushButton_2, 1); + m_pSignalMapper->setMapping(ui->pushButton_3, 2); + m_pSignalMapper->setMapping(ui->pushButton_4, 3); + m_pSignalMapper->setMapping(ui->pushButton_5, 4); + m_pSignalMapper->setMapping(ui->pushButton_6, 5); + m_pSignalMapper->setMapping(ui->pushButton_7, 6); + m_pSignalMapper->setMapping(ui->pushButton_8, 7); + m_pSignalMapper->setMapping(ui->pushButton_9, 8); + m_pSignalMapper->setMapping(ui->pushButton_10, 9); + m_pSignalMapper->setMapping(ui->pushButton_11, 10); + m_pSignalMapper->setMapping(ui->pushButton_12, 11); + m_pSignalMapper->setMapping(ui->pushButton_13, 12); + m_pSignalMapper->setMapping(ui->pushButton_14, 13); + m_pSignalMapper->setMapping(ui->pushButton_15, 14); + m_pSignalMapper->setMapping(ui->pushButton_16, 15); + m_pSignalMapper->setMapping(ui->pushButton_17, 16); + m_pSignalMapper->setMapping(ui->pushButton_18, 17); + m_pSignalMapper->setMapping(ui->pushButton_19, 18); + m_pSignalMapper->setMapping(ui->pushButton_20, 19); + m_pSignalMapper->setMapping(ui->pushButton_21, 20); + m_pSignalMapper->setMapping(ui->pushButton_22, 21); + m_pSignalMapper->setMapping(ui->pushButton_23, 22); + m_pSignalMapper->setMapping(ui->pushButton_24, 23); + m_pSignalMapper->setMapping(ui->pushButton_25, 24); + m_pSignalMapper->setMapping(ui->pushButton_26, 25); + m_pSignalMapper->setMapping(ui->pushButton_27, 26); + m_pSignalMapper->setMapping(ui->pushButton_28, 27); + m_pSignalMapper->setMapping(ui->pushButton_29, 28); + m_pSignalMapper->setMapping(ui->pushButton_30, 29); + m_pSignalMapper->setMapping(ui->pushButton_31, 30); + m_pSignalMapper->setMapping(ui->pushButton_32, 31); + m_pSignalMapper->setMapping(ui->pushButton_33, 32); + m_pSignalMapper->setMapping(ui->pushButton_34, 33); + m_pSignalMapper->setMapping(ui->pushButton_35, 34); + m_pSignalMapper->setMapping(ui->pushButton_36, 35); + m_pSignalMapper->setMapping(ui->pushButton_37, 36); + m_pSignalMapper->setMapping(ui->pushButton_38, 37); + m_pSignalMapper->setMapping(ui->pushButton_40, 38); + + connect(ui->pushButton_1,SIGNAL(clicked(bool)),m_pSignalMapper,SLOT(map())); @@ -93,7 +186,7 @@ KeyboardWidget::KeyboardWidget(QWidget *parent) : connect(ui->pushButton_38,SIGNAL(clicked(bool)),m_pSignalMapper,SLOT(map())); connect(ui->pushButton_40,SIGNAL(clicked(bool)),m_pSignalMapper,SLOT(map())); - connect(m_pSignalMapper,SIGNAL(mapped(QString)), this, SLOT(onKeyboardClicked(QString))); + connect(m_pSignalMapper,SIGNAL(mapped(int)), this, SLOT(onKeyboardClicked(int))); foreach (QPushButton *button, findChildren()) connect(button, &QPushButton::pressed, SoundPlayer::playClick); @@ -106,6 +199,10 @@ KeyboardWidget::~KeyboardWidget() void KeyboardWidget::on_pushButton_41_clicked() { + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); + m_nCurTabPos = 40; + m_pCurCheckedBtn = m_vectorTabOrder[m_nCurTabPos]; + m_pCurCheckedBtn->setChecked(true); QKeyEvent key(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier); QGuiApplication::sendEvent(QApplication::focusObject(),&key); emit onOkKeyClicked(); @@ -113,25 +210,87 @@ void KeyboardWidget::on_pushButton_41_clicked() void KeyboardWidget::on_pushButton_42_clicked() { + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); + m_nCurTabPos = 41; + m_pCurCheckedBtn = m_vectorTabOrder[m_nCurTabPos]; + m_pCurCheckedBtn->setChecked(true); + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); emit onCancelKeyClicked(); } void KeyboardWidget::on_pushButton_39_clicked() { qDebug() << qApp->focusObject(); + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); + m_nCurTabPos = 38; + m_pCurCheckedBtn = m_vectorTabOrder[m_nCurTabPos]; + m_pCurCheckedBtn->setChecked(true); QKeyEvent key(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); QGuiApplication::sendEvent(QApplication::focusObject(),&key); emit onBackspaceKeyClicked(); } -void KeyboardWidget::onKeyboardClicked(const QString in){ +void KeyboardWidget::onKeyboardClicked(const int in){ QInputMethodEvent event; - event.setCommitString(in); + qDebug()<< "keyboard clicked" << in; + event.setCommitString(m_mapKeyboard[in]); + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); + if( in < 38) m_nCurTabPos = in; + else if( in == 38) m_nCurTabPos = 39; + m_pCurCheckedBtn = m_vectorTabOrder[m_nCurTabPos]; + m_pCurCheckedBtn->setChecked(true); QGuiApplication::sendEvent(QApplication::focusObject(),&event); - emit onKeyboardClickSignal(in); + emit onKeyboardClickSignal(m_mapKeyboard[in]); } void KeyboardWidget::on_pushButton_40_clicked() { emit onSpaceKeyClicked(); } + +void KeyboardWidget::keyPressEvent(QKeyEvent *event){ + +} + +void KeyboardWidget::keyReleaseEvent(QKeyEvent *event){ + switch (event->key()) + { + case 0x01000030: // Turn left + if(m_nCurTabPos > 0 ) m_nCurTabPos--; + else m_nCurTabPos = m_vectorTabOrder.size()-1; + if(m_pCurCheckedBtn !=NULL) m_pCurCheckedBtn->setChecked(false); + m_pCurCheckedBtn = m_vectorTabOrder[m_nCurTabPos]; + m_pCurCheckedBtn->setChecked(true); + break; + case 0x01000031: // Push + { + if(m_pCurCheckedBtn != NULL){ + m_pCurCheckedBtn->click(); + } + break; + } + case 0x01000032: // Turn right + if(m_nCurTabPos < (m_vectorTabOrder.size() -1)) m_nCurTabPos++; + else m_nCurTabPos=0; + if(m_pCurCheckedBtn !=NULL) m_pCurCheckedBtn->setChecked(false); + m_pCurCheckedBtn = m_vectorTabOrder[m_nCurTabPos]; + m_pCurCheckedBtn->setChecked(true); + break; + } +} + +void KeyboardWidget::focusInKeyboard(){ + m_nCurTabPos = 0; + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); + m_pCurCheckedBtn = m_vectorTabOrder[0]; + m_pCurCheckedBtn->setChecked(true); + this->grabKeyboard(); +} + +void KeyboardWidget::focusOutKeyboard(){ + m_nCurTabPos = 0; + if(m_pCurCheckedBtn != NULL) m_pCurCheckedBtn->setChecked(false); + this->releaseKeyboard(); +} + + diff --git a/app/gui/oven_control/keyboardwidget.h b/app/gui/oven_control/keyboardwidget.h index bc7d4ea..9aa1190 100644 --- a/app/gui/oven_control/keyboardwidget.h +++ b/app/gui/oven_control/keyboardwidget.h @@ -4,6 +4,9 @@ #include #include #include +#include +#include + namespace Ui { class KeyboardWidget; @@ -34,12 +37,23 @@ signals: void onSpaceKeyClicked(); public slots: - void onKeyboardClicked(const QString in); + void onKeyboardClicked(int in); + void focusInKeyboard(); + void focusOutKeyboard(); + +protected: + void keyPressEvent(QKeyEvent* event); + void keyReleaseEvent(QKeyEvent* event); + private: Ui::KeyboardWidget *ui; QSignalMapper *m_pSignalMapper; + + QVector m_vectorTabOrder; + QPushButton* m_pCurCheckedBtn; + int m_nCurTabPos; }; #endif // KEYBOARDWIDGET_H diff --git a/app/gui/oven_control/keyboardwidget.ui b/app/gui/oven_control/keyboardwidget.ui index 5de7ed1..5a0b4b2 100644 --- a/app/gui/oven_control/keyboardwidget.ui +++ b/app/gui/oven_control/keyboardwidget.ui @@ -49,12 +49,15 @@ QPushButton { border-image: url(:/images/keyboard/088_keyboard_a033.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a033_ov.png); } +QPushButton:pressed, QPushButton:checked , QPushButton:checked{ border-image: url(:/images/keyboard/088_keyboard_a033_ov.png); } + + true + false @@ -79,12 +82,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a033_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a016.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a016_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a016_ov.png); } + + true + false @@ -109,12 +115,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a016_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a009.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a009_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a009_ov.png); } + + true + false @@ -139,12 +148,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a009_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a020.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a020_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a020_ov.png); } + + true + false @@ -169,12 +181,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a020_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a012.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a012_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a012_ov.png); } + + true + false @@ -199,12 +214,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a012_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a022.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a022_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a022_ov.png); } + + true + false @@ -229,12 +247,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a022_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a034.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a034_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a034_ov.png); } + + true + false @@ -259,12 +280,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a034_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a036.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a036_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a036_ov.png); } + + true + false @@ -289,12 +313,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a036_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a038.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a038_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a038_ov.png); } + + true + false @@ -319,12 +346,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a038_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a019.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a019_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a019_ov.png); } + + true + false @@ -349,12 +379,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a019_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a006.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a006_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a006_ov.png); } + + true + false @@ -379,12 +412,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a006_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a021.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a021_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a021_ov.png); } + + true + false @@ -409,12 +445,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a021_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a014.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a014_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a014_ov.png); } + + true + false @@ -439,12 +478,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a014_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a023.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a023_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a023_ov.png); } + + true + false @@ -469,12 +511,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a023_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a008.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a008_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a008_ov.png); } + + true + false @@ -495,16 +540,19 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a008_ov.p - Qt::NoFocus + Qt::TabFocus QPushButton { border-image: url(:/images/keyboard/088_keyboard_a003.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a003_ov.png); } +QPushButton:pressed, QPushButton:checked{ border-image: url(:/images/keyboard/088_keyboard_a003_ov.png); } + + true + false @@ -525,16 +573,19 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a003_ov.p - Qt::NoFocus + Qt::TabFocus QPushButton { border-image: url(:/images/keyboard/088_keyboard_a002.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a002_ov.png); } +QPushButton:pressed , QPushButton:checked{ border-image: url(:/images/keyboard/088_keyboard_a002_ov.png); } + + true + false @@ -559,12 +610,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a002_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a029.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a029_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a029_ov.png); } + + true + false @@ -589,12 +643,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a029_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a010.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a010_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a010_ov.png); } + + true + false @@ -619,12 +676,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a010_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a028.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a028_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a028_ov.png); } + + true + false @@ -649,12 +709,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a028_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a018.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a018_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a018_ov.png); } + + true + false @@ -675,16 +738,19 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a018_ov.p - Qt::NoFocus + Qt::TabFocus QPushButton { border-image: url(:/images/keyboard/088_keyboard_a001.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a001_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a001_ov.png); } + + true + false @@ -709,12 +775,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a001_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a015.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a015_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a015_ov.png); } + + true + false @@ -739,12 +808,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a015_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a035.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a035_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a035_ov.png); } + + true + false @@ -769,12 +841,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a035_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a026.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a026_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a026_ov.png); } + + true + false @@ -799,12 +874,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a026_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a011.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a011_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a011_ov.png); } + + true + false @@ -829,12 +907,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a011_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a031.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a031_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a031_ov.png); } + + true + false @@ -859,12 +940,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a031_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a004.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a004_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a004_ov.png); } + + true + false @@ -889,12 +973,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a004_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a017.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a017_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a017_ov.png); } + + true + false @@ -919,12 +1006,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a017_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a030.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a030_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a030_ov.png); } + + true + false @@ -949,12 +1039,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a030_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a005.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a005_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a005_ov.png); } + + true + false @@ -979,12 +1072,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a005_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a007.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a007_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a007_ov.png); } + + true + false @@ -1009,12 +1105,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a007_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a032.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a032_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a032_ov.png); } + + true + false @@ -1039,12 +1138,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a032_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a013.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a013_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a013_ov.png); } + + true + false @@ -1069,12 +1171,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a013_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a025.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a025_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a025_ov.png); } + + true + false @@ -1099,12 +1204,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a025_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a039.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a039_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a039_ov.png); } + + true + true @@ -1132,12 +1240,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a039_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a024.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a024_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a024_ov.png); } + + true + false @@ -1162,12 +1273,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a024_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a037.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a037_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a037_ov.png); } + + true + false @@ -1192,12 +1306,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a037_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a027.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a027_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a027_ov.png); } + + true + false @@ -1222,12 +1339,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a027_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a040.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a040_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a040_ov.png); } + + true + false @@ -1252,12 +1372,15 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a040_ov.p QPushButton { border-image: url(:/images/keyboard/088_keyboard_a041.png);} -QPushButton:pressed , QPushButton::focus { border-image: url(:/images/keyboard/088_keyboard_a041_ov.png); } +QPushButton:pressed , QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a041_ov.png); } + + true + false @@ -1282,12 +1405,15 @@ QPushButton:pressed , QPushButton::focus { border-image: url(:/images/keyboard/0 QPushButton { border-image: url(:/images/keyboard/088_keyboard_a042.png);} -QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a042_ov.png); } +QPushButton:pressed, QPushButton:checked { border-image: url(:/images/keyboard/088_keyboard_a042_ov.png); } + + true + false @@ -1296,6 +1422,11 @@ QPushButton:pressed { border-image: url(:/images/keyboard/088_keyboard_a042_ov.p + + pushButton_1 + pushButton_2 + pushButton_3 + -- 2.1.4