From f10c6437d6467656644372f1b642983baeafe28b Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 14 Jun 2018 14:37:31 +0200 Subject: [PATCH] sending the initial input method event for clearing the cursor asynchronously --- src/inputpanel/QskInputPanel.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/inputpanel/QskInputPanel.cpp b/src/inputpanel/QskInputPanel.cpp index 4bb32d89..810f9cdf 100644 --- a/src/inputpanel/QskInputPanel.cpp +++ b/src/inputpanel/QskInputPanel.cpp @@ -317,12 +317,16 @@ void QskInputPanel::attachInputItem( QQuickItem* item ) if ( inputProxy() ) { - // hiding the cursor in item + /* + Hiding the cursor in item. We use postEvent + so that everything on the item is done, + when receiving the event. + */ const QInputMethodEvent::Attribute attribute( QInputMethodEvent::Cursor, 0, 0, QVariant() ); - QInputMethodEvent event( QString(), { attribute } ); - QCoreApplication::sendEvent( item, &event ); + QCoreApplication::postEvent( item, + new QInputMethodEvent( QString(), { attribute } ) ); } } else