fixing unwanted side effects of input method events
This commit is contained in:
parent
c07cf24800
commit
4fa3c6e5b7
|
@ -35,7 +35,7 @@ static inline void qskPropagateReadOnly( QskTextInput* input )
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void qskTranslateMouseEventPosition(
|
static inline void qskTranslateMouseEventPosition(
|
||||||
QMouseEvent* mouseEvent, const QPointF& offset )
|
QMouseEvent* mouseEvent, const QPointF& offset )
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
auto& point = mouseEvent->point(0);
|
auto& point = mouseEvent->point(0);
|
||||||
|
@ -142,6 +142,27 @@ namespace
|
||||||
|
|
||||||
break;
|
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:
|
default:
|
||||||
ok = this->event( event );
|
ok = this->event( event );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue