fixing unwanted side effects of input method events
This commit is contained in:
parent
c07cf24800
commit
4fa3c6e5b7
|
@ -142,6 +142,27 @@ namespace
|
|||
|
||||
break;
|
||||
}
|
||||
case QEvent::InputMethod:
|
||||
{
|
||||
const bool hadCursor = isCursorVisible();
|
||||
|
||||
ok = this->event( event );
|
||||
|
||||
if ( isCursorVisible() && !hadCursor )
|
||||
{
|
||||
/*
|
||||
The initial InputMethod events might be sent from the
|
||||
platform depending on focus. Unfortunately an
|
||||
empty dummy event ( = no attributes ) leads to showing
|
||||
the cursor.
|
||||
*/
|
||||
auto input = static_cast< const QskTextInput* >( parentItem() );
|
||||
if ( !input->isEditing() )
|
||||
setCursorVisible( false );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ok = this->event( event );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue