diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index b63729cd87..a8a3ad1447 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -595,9 +595,15 @@ public: QSize adjustedSize() const; inline void handleSoftwareInputPanel(Qt::MouseButton button, bool clickCausedFocus) + { + if (button == Qt::LeftButton) + handleSoftwareInputPanel(clickCausedFocus); + } + + inline void handleSoftwareInputPanel(bool clickCausedFocus = false) { Q_Q(QWidget); - if (button == Qt::LeftButton && qApp->autoSipEnabled()) { + if (qApp->autoSipEnabled()) { QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( q->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index a308f92f9d..814d194817 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1787,6 +1787,8 @@ void QLineEdit::keyPressEvent(QKeyEvent *event) void QLineEdit::keyReleaseEvent(QKeyEvent *) { Q_D(QLineEdit); + if (!isReadOnly()) + d->handleSoftwareInputPanel(); d->control->updateCursorBlinking(); } diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 71aecc4275..075f27d009 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -1830,10 +1830,11 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e) void QPlainTextEdit::keyReleaseEvent(QKeyEvent *e) { Q_D(QPlainTextEdit); + if (!isReadOnly()) + d->handleSoftwareInputPanel(); d->keyboardModifiers = e->modifiers(); #ifdef QT_KEYPAD_NAVIGATION - Q_D(QPlainTextEdit); if (QApplicationPrivate::keypadNavigationEnabled()) { if (!e->isAutoRepeat() && e->key() == Qt::Key_Back && d->deleteAllTimer.isActive()) { diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 55fb8adc5d..c553e99d57 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -1456,8 +1456,10 @@ void QTextEdit::keyPressEvent(QKeyEvent *e) */ void QTextEdit::keyReleaseEvent(QKeyEvent *e) { -#ifdef QT_KEYPAD_NAVIGATION Q_D(QTextEdit); + if (!isReadOnly()) + d->handleSoftwareInputPanel(); +#ifdef QT_KEYPAD_NAVIGATION if (QApplicationPrivate::keypadNavigationEnabled()) { if (!e->isAutoRepeat() && e->key() == Qt::Key_Back && d->deleteAllTimer.isActive()) {