From d8906c5f36540baef2886e5c6f5b7b4199525f5c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 17 Aug 2018 13:55:36 +0200 Subject: Print the focus window when InputContext::sendKeyClick() fails So far I've been unable to reproduce the flakiness with a Windows CI VM, so let's add some extra context to the warning message that is printed before the test (sometimes) fails. Task-number: QTBUG-62518 Change-Id: Idebaadb93fe2f38a94a9f096bc044b28171afafd Reviewed-by: Liang Qi --- src/virtualkeyboard/inputcontext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp index 21369f7c..80739819 100644 --- a/src/virtualkeyboard/inputcontext.cpp +++ b/src/virtualkeyboard/inputcontext.cpp @@ -444,7 +444,7 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers) if (d->focus && d->inputContext) { QKeyEvent pressEvent(QEvent::KeyPress, key, Qt::KeyboardModifiers(modifiers), text); QKeyEvent releaseEvent(QEvent::KeyRelease, key, Qt::KeyboardModifiers(modifiers), text); - VIRTUALKEYBOARD_DEBUG() << "InputContext::::sendKeyClick():" << key; + VIRTUALKEYBOARD_DEBUG() << "InputContext::sendKeyClick():" << key; d->stateFlags |= InputContextPrivate::KeyEventState; d->inputContext->sendKeyEvent(&pressEvent); @@ -452,7 +452,8 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers) if (d->activeKeys.isEmpty()) d->stateFlags &= ~InputContextPrivate::KeyEventState; } else { - qWarning() << "InputContext::::sendKeyClick():" << key << "no focus"; + qWarning() << "InputContext::sendKeyClick(): no focus to send key click" << key << text + << "- QGuiApplication::focusWindow() is:" << QGuiApplication::focusWindow(); } } -- cgit v1.2.3