diff --git a/app/gui/oven_control/config1digitsetdlg.cpp b/app/gui/oven_control/config1digitsetdlg.cpp index 4263305..f916b83 100644 --- a/app/gui/oven_control/config1digitsetdlg.cpp +++ b/app/gui/oven_control/config1digitsetdlg.cpp @@ -47,6 +47,7 @@ Config1DigitSetDlg::Config1DigitSetDlg(QWidget *parent, ConfigType type) : strTemp1.sprintf("%%0%d",setting_val.maxlen); + ui->ctrSpBxValue->installEventFilter(this); } @@ -68,3 +69,13 @@ void Config1DigitSetDlg::on_ctrBtnCancel_clicked() { reject(); } + +bool Config1DigitSetDlg::eventFilter(QObject *object, QEvent *event){ + if (object == ui->ctrSpBxValue && event->type() == QEvent::MouseButtonRelease ) + { + ui->ctrSpBxValue->selectAll(); + qDebug() << "Mouse Release2"; + + } + return QWidget::eventFilter(object, event); +} diff --git a/app/gui/oven_control/config1digitsetdlg.h b/app/gui/oven_control/config1digitsetdlg.h index 4bca143..ca655dd 100644 --- a/app/gui/oven_control/config1digitsetdlg.h +++ b/app/gui/oven_control/config1digitsetdlg.h @@ -23,6 +23,8 @@ private slots: void on_ctrBtnCancel_clicked(); + bool eventFilter(QObject *, QEvent *); + private: Ui::Config1DigitSetDlg *ui; ConfigType m_nType; diff --git a/app/gui/oven_control/configbacklightdlg.ui b/app/gui/oven_control/configbacklightdlg.ui index 53d8bc1..8966207 100644 --- a/app/gui/oven_control/configbacklightdlg.ui +++ b/app/gui/oven_control/configbacklightdlg.ui @@ -186,6 +186,16 @@ QPushButton::pressed, QPushButton::focus{ <underline>true</underline> </font> </property> + <property name="styleSheet"> + <string notr="true">QPushButton{ + border : none; + color : white; +} + +QPushButton::pressed, QPushButton::focus{ + color : yellow; +}</string> + </property> <property name="text"> <string>취소</string> </property> @@ -211,6 +221,16 @@ QPushButton::pressed, QPushButton::focus{ <underline>true</underline> </font> </property> + <property name="styleSheet"> + <string notr="true">QPushButton{ + border : none; + color : white; +} + +QPushButton::pressed, QPushButton::focus{ + color : yellow; +}</string> + </property> <property name="text"> <string>확인</string> </property> diff --git a/app/gui/oven_control/configdatetimedlg.ui b/app/gui/oven_control/configdatetimedlg.ui index f77df90..5ee2eb4 100644 --- a/app/gui/oven_control/configdatetimedlg.ui +++ b/app/gui/oven_control/configdatetimedlg.ui @@ -351,6 +351,9 @@ QPushButton::pressed, QPushButton::focus{ <kerning>true</kerning> </font> </property> + <property name="mouseTracking"> + <bool>false</bool> + </property> <property name="focusPolicy"> <enum>Qt::StrongFocus</enum> </property> @@ -467,13 +470,8 @@ QPushButton::pressed, QPushButton::focus{ <height>600</height> </rect> </property> - <zorder>centralwidget</zorder> - <zorder>centralwidget</zorder> - <zorder>centralwidget</zorder> </widget> </widget> - <zorder>centralwidget</zorder> - <zorder>keyboardwidget</zorder> </widget> <customwidgets> <customwidget> diff --git a/app/gui/oven_control/configmastervolumedlg.ui b/app/gui/oven_control/configmastervolumedlg.ui index 4c5fcde..26c1a32 100644 --- a/app/gui/oven_control/configmastervolumedlg.ui +++ b/app/gui/oven_control/configmastervolumedlg.ui @@ -186,6 +186,16 @@ QPushButton::pressed, QPushButton::focus{ <underline>true</underline> </font> </property> + <property name="styleSheet"> + <string notr="true">QPushButton{ + border : none; + color : white; +} + +QPushButton::pressed, QPushButton::focus{ + color : yellow; +}</string> + </property> <property name="text"> <string>취소</string> </property> @@ -211,6 +221,16 @@ QPushButton::pressed, QPushButton::focus{ <underline>true</underline> </font> </property> + <property name="styleSheet"> + <string notr="true">QPushButton{ + border : none; + color : white; +} + +QPushButton::pressed, QPushButton::focus{ + color : yellow; +}</string> + </property> <property name="text"> <string>확인</string> </property> diff --git a/app/gui/oven_control/configwindow.cpp b/app/gui/oven_control/configwindow.cpp index 88e12cf..ea0fc38 100644 --- a/app/gui/oven_control/configwindow.cpp +++ b/app/gui/oven_control/configwindow.cpp @@ -8,7 +8,7 @@ #include "configinfodlg.h" #include "yesnopopupdlg.h" #include "configdatetimedlg.h" - +#include "servicepassinputdlg.h" @@ -110,9 +110,13 @@ void ConfigWindow::onConfigBtnClicked(uint16_t id){ break; case config_enter_engineer_mode: { - EngineerMenuWindow *w = new EngineerMenuWindow(this); - w->setWindowModality(Qt::WindowModal); - w->showFullScreen(); + dlg = new ServicePassInputDlg(this); + dlg->exec(); + if(dlg->result() == QDialog::Accepted){ + EngineerMenuWindow *w = new EngineerMenuWindow(this); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + } break; } case config_software_info: diff --git a/app/gui/oven_control/formatterspinbox.cpp b/app/gui/oven_control/formatterspinbox.cpp index 3e0437e..cf707ed 100644 --- a/app/gui/oven_control/formatterspinbox.cpp +++ b/app/gui/oven_control/formatterspinbox.cpp @@ -1,4 +1,5 @@ #include <QtWidgets> +#include <QDebug> #include "formatterspinbox.h" @@ -6,6 +7,7 @@ FormatterSpinBox::FormatterSpinBox(QWidget *parent) : QSpinBox(parent) { m_nwidth = 2; + } //! [1] @@ -27,3 +29,11 @@ FormatterSpinBox::FormatterSpinBox(QWidget *parent) void FormatterSpinBox::setFormatterWidth(int wid){ m_nwidth = wid; } + + void FormatterSpinBox::focusInEvent(QFocusEvent *event){ + QTimer::singleShot(200,this,SLOT(selectAll())); + } + + void FormatterSpinBox::mouseReleaseEvent(QMouseEvent *event){ + this->selectAll(); + } diff --git a/app/gui/oven_control/formatterspinbox.h b/app/gui/oven_control/formatterspinbox.h index 8ae6cc3..ba632fe 100644 --- a/app/gui/oven_control/formatterspinbox.h +++ b/app/gui/oven_control/formatterspinbox.h @@ -19,6 +19,10 @@ public: QString textFromValue(int value) const Q_DECL_OVERRIDE; void setFormatterWidth(int wid); + + void focusInEvent(QFocusEvent *event); + + void mouseReleaseEvent(QMouseEvent *event); }; #endif // SPINBOX_H diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index e48983a..1d2c9d5 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -98,7 +98,8 @@ SOURCES += main.cpp\ modelsettingwindow.cpp \ gasmodelsettingwindow.cpp \ electricmodelsettingwindow.cpp \ - system.cpp + system.cpp \ + servicepassinputdlg.cpp HEADERS += mainwindow.h \ cook.h \ @@ -186,7 +187,8 @@ HEADERS += mainwindow.h \ modelsettingwindow.h \ gasmodelsettingwindow.h \ electricmodelsettingwindow.h \ - system.h + system.h \ + servicepassinputdlg.h FORMS += mainwindow.ui \ manualcookwindow.ui \ @@ -247,7 +249,8 @@ FORMS += mainwindow.ui \ configfavoritebutton.ui \ modelsettingwindow.ui \ gasmodelsettingwindow.ui \ - electricmodelsettingwindow.ui + electricmodelsettingwindow.ui \ + servicepassinputdlg.ui RESOURCES += \ resources.qrc diff --git a/app/gui/oven_control/servicepassinputdlg.cpp b/app/gui/oven_control/servicepassinputdlg.cpp new file mode 100644 index 0000000..5bd3dfa --- /dev/null +++ b/app/gui/oven_control/servicepassinputdlg.cpp @@ -0,0 +1,33 @@ +#include "servicepassinputdlg.h" +#include "ui_servicepassinputdlg.h" + +#define PASS_WORD "0000" + +ServicePassInputDlg::ServicePassInputDlg(QWidget *parent) : + QDialog(parent), + ui(new Ui::ServicePassInputDlg) +{ + ui->setupUi(this); + setWindowFlags(Qt::FramelessWindowHint); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_TranslucentBackground); + setAttribute(Qt::WA_DeleteOnClose); +} + +ServicePassInputDlg::~ServicePassInputDlg() +{ + delete ui; +} + +void ServicePassInputDlg::on_ctrBtnOk_clicked() +{ + if(ui->lineEdit->text() == PASS_WORD){ + accept(); + } + else reject(); +} + +void ServicePassInputDlg::on_ctrBtnCancel_clicked() +{ + reject(); +} diff --git a/app/gui/oven_control/servicepassinputdlg.h b/app/gui/oven_control/servicepassinputdlg.h new file mode 100644 index 0000000..df17bbb --- /dev/null +++ b/app/gui/oven_control/servicepassinputdlg.h @@ -0,0 +1,27 @@ +#ifndef SERVICEPASSINPUTDLG_H +#define SERVICEPASSINPUTDLG_H + +#include <QDialog> + +namespace Ui { +class ServicePassInputDlg; +} + +class ServicePassInputDlg : public QDialog +{ + Q_OBJECT + +public: + explicit ServicePassInputDlg(QWidget *parent = 0); + ~ServicePassInputDlg(); + +private slots: + void on_ctrBtnOk_clicked(); + + void on_ctrBtnCancel_clicked(); + +private: + Ui::ServicePassInputDlg *ui; +}; + +#endif // SERVICEPASSINPUTDLG_H diff --git a/app/gui/oven_control/servicepassinputdlg.ui b/app/gui/oven_control/servicepassinputdlg.ui new file mode 100644 index 0000000..e1f23a8 --- /dev/null +++ b/app/gui/oven_control/servicepassinputdlg.ui @@ -0,0 +1,259 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ServicePassInputDlg</class> + <widget class="QDialog" name="ServicePassInputDlg"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>1600</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <property name="styleSheet"> + <string notr="true">#ConfigDateTimeDlg{ + /*background-color : transparent;*/ +} + +#centralwidget{ + background-image : url(:/images/background/popup/913.png); +} + +QLabel { + color : white; +} +QLineEdit{ + background-color : transparent; + color : white; +} + +QSpinBox{ + background-color : transparent; + color : white; +} + +QPushButton{ + border-color : transparent; + background-color : transparent; + color : white; +} +QPushButton::pressed, QPushButton::focus{ + color : yellow; +}</string> + </property> + <widget class="QWidget" name="centralwidget" native="true"> + <property name="geometry"> + <rect> + <x>0</x> + <y>425</y> + <width>900</width> + <height>1025</height> + </rect> + </property> + <widget class="QWidget" name="verticalLayoutWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>901</width> + <height>441</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,6,4"> + <property name="spacing"> + <number>0</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="topMargin"> + <number>30</number> + </property> + <item> + <widget class="QLabel" name="ctrLbTitle_2"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>94</height> + </size> + </property> + <property name="font"> + <font> + <family>나눔고딕</family> + <pointsize>18</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color : white;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/images/config/051_password_icon.png</pixmap> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="ctrLbTitle"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>40</height> + </size> + </property> + <property name="font"> + <font> + <family>나눔고딕</family> + <pointsize>10</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color : white;</string> + </property> + <property name="text"> + <string>서비스</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <layout class="QGridLayout" name="gridLayout_2" columnstretch="94"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>30</number> + </property> + <property name="rightMargin"> + <number>20</number> + </property> + <property name="horizontalSpacing"> + <number>13</number> + </property> + <property name="verticalSpacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLineEdit" name="lineEdit"> + <property name="font"> + <font> + <pointsize>30</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true"> QLineEdit[echoMode="2"] { + lineedit-password-character: 8251; + }</string> + </property> + <property name="inputMask"> + <string>9999</string> + </property> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QGridLayout" name="gridLayout" columnstretch="1,1,1,1,1,1"> + <property name="leftMargin"> + <number>10</number> + </property> + <property name="rightMargin"> + <number>10</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item row="0" column="5"> + <widget class="QPushButton" name="ctrBtnCancel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>나눔고딕</family> + <pointsize>12</pointsize> + <underline>true</underline> + </font> + </property> + <property name="text"> + <string>취소</string> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="4"> + <widget class="QPushButton" name="ctrBtnOk"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>나눔고딕</family> + <pointsize>12</pointsize> + <underline>true</underline> + </font> + </property> + <property name="text"> + <string>확인</string> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="KeyboardWidget" name="keyboardwidget" native="true"> + <property name="geometry"> + <rect> + <x>0</x> + <y>425</y> + <width>900</width> + <height>600</height> + </rect> + </property> + </widget> + </widget> + </widget> + <customwidgets> + <customwidget> + <class>KeyboardWidget</class> + <extends>QWidget</extends> + <header>keyboardwidget.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources> + <include location="resources.qrc"/> + </resources> + <connections/> +</ui>