QWidgets: show SoftwareInputPanel for key release
Virtual keyboard should be shown when editable widget get focus by key (like Tab or BackTab). Before this change SoftwareInputPanel was handled only for mouseKeyRelease event Task-number: QTBUG-61652 Pick-to: 5.15 Change-Id: I85f80422b596592a04c2f9af214f991c471485c8 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
This commit is contained in:
parent
d831035435
commit
93038767b7
@ -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) {
|
||||
|
@ -1787,6 +1787,8 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
|
||||
void QLineEdit::keyReleaseEvent(QKeyEvent *)
|
||||
{
|
||||
Q_D(QLineEdit);
|
||||
if (!isReadOnly())
|
||||
d->handleSoftwareInputPanel();
|
||||
d->control->updateCursorBlinking();
|
||||
}
|
||||
|
||||
|
@ -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()) {
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user