From 25d8f9da70401b4c9fb545eb488037f76ba770f7 Mon Sep 17 00:00:00 2001 From: Dong Rui Date: Wed, 26 Aug 2020 13:07:39 +0800 Subject: QLineEdit: Fix editingFinished() not being emitted when pressing the clear button When pressing the clear button, the editingFinished() signal was not received when focussing out. Call _q_textEdited(QString()) when pressing the clear button. Fixes: QTBUG-83295 Change-Id: Ie4bc6d9a2f27f89163c05c4c15175540c7631a30 Reviewed-by: Liang Qi (cherry picked from commit c5904cb96aed3b171c543a2cf0bed8f8ac5f95c4) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qlineedit_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 1839941036..4143b848b5 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -479,7 +479,7 @@ void QLineEditPrivate::_q_clearButtonClicked() Q_Q(QLineEdit); if (!q->text().isEmpty()) { q->clear(); - emit q->textEdited(QString()); + _q_textEdited(QString()); } } -- cgit v1.2.3