File tree Expand file tree Collapse file tree 2 files changed +38
-4
lines changed
Expand file tree Collapse file tree 2 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -1087,3 +1087,30 @@ TypeLabel *CompressSettingPage::getClickLbl() const
10871087 // qDebug() << "getClickLbl called";
10881088 return m_pClickLbl;
10891089}
1090+
1091+ void CompressSettingPage::mousePressEvent (QMouseEvent *event)
1092+ {
1093+ // 点击空白区域时,清除输入框焦点
1094+ if (m_pFileNameEdt && m_pFileNameEdt->lineEdit ()->hasFocus ()) {
1095+ qDebug () << " Clearing focus from file name edit" ;
1096+ m_pFileNameEdt->lineEdit ()->clearFocus ();
1097+ }
1098+ if (m_pSavePathEdt && m_pSavePathEdt->lineEdit ()->hasFocus ()) {
1099+ qDebug () << " Clearing focus from save path edit" ;
1100+ m_pSavePathEdt->lineEdit ()->clearFocus ();
1101+ }
1102+ if (m_pPasswordEdt && m_pPasswordEdt->lineEdit ()->hasFocus ()) {
1103+ qDebug () << " Clearing focus from password edit" ;
1104+ m_pPasswordEdt->lineEdit ()->clearFocus ();
1105+ }
1106+ if (m_pSplitValueEdt && m_pSplitValueEdt->hasFocus ()) {
1107+ qDebug () << " Clearing focus from split value edit" ;
1108+ m_pSplitValueEdt->clearFocus ();
1109+ }
1110+ if (m_pCommentEdt && m_pCommentEdt->hasFocus ()) {
1111+ qDebug () << " Clearing focus from comment edit" ;
1112+ m_pCommentEdt->clearFocus ();
1113+ }
1114+
1115+ DWidget::mousePressEvent (event);
1116+ }
Original file line number Diff line number Diff line change @@ -76,19 +76,26 @@ class CompressSettingPage : public DWidget
7676 */
7777 QString getComment () const ;
7878
79+ /* *
80+ * @brief 是否定制模式
81+ * @return
82+ */
83+ bool isOrderMode ();
84+
7985 /* *
8086 * @brief eventFilter 事件过滤,处理键盘事件等
8187 * @param watched
8288 * @param event
8389 * @return
8490 */
8591 bool eventFilter (QObject *watched, QEvent *event) override ;
92+
93+ protected:
8694 /* *
87- * @brief 是否定制模式
88- * @return
95+ * @brief mousePressEvent 鼠标点击事件,点击空白区域取消输入框焦点
96+ * @param event
8997 */
90- bool isOrderMode ();
91-
98+ void mousePressEvent (QMouseEvent *event) override ;
9299private:
93100 /* *
94101 * @brief initUI 初始化界面
You can’t perform that action at this time.
0 commit comments