sending the initial input method event for clearing the cursor

asynchronously
This commit is contained in:
Uwe Rathmann 2018-06-14 14:37:31 +02:00
parent 5cc45e35e2
commit f10c6437d6
1 changed files with 7 additions and 3 deletions

View File

@ -317,12 +317,16 @@ void QskInputPanel::attachInputItem( QQuickItem* item )
if ( inputProxy() ) 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( const QInputMethodEvent::Attribute attribute(
QInputMethodEvent::Cursor, 0, 0, QVariant() ); QInputMethodEvent::Cursor, 0, 0, QVariant() );
QInputMethodEvent event( QString(), { attribute } ); QCoreApplication::postEvent( item,
QCoreApplication::sendEvent( item, &event ); new QInputMethodEvent( QString(), { attribute } ) );
} }
} }
else else