QAndroidInputContext: Fix start value of Cursor attribute in longPress()
The value of start for a QInputMethodEvent::Cursor attribute must be specified relative to the start of preedit string, but longPress() was specifying it relative to start of surrounding text. This was causing QQuickTextInput to return wrong values of cursor and anchor rectangles. And this was causing invalid positioning of cursor selection handles after a long press. Change-Id: Ief67e86dd90b09ebf2ba191a2b0311ff803afdd9 Reviewed-by: BogDan Vatra <bogdan@kdab.com>bb10
parent
4d2ee7f358
commit
c905ff4392
|
|
@ -791,7 +791,7 @@ void QAndroidInputContext::longPress(int x, int y)
|
|||
return;
|
||||
}
|
||||
QList<QInputMethodEvent::Attribute> imAttributes;
|
||||
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursor, 0, QVariant()));
|
||||
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant()));
|
||||
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, anchor, cursor - anchor, QVariant()));
|
||||
QInputMethodEvent event(QString(), imAttributes);
|
||||
QGuiApplication::sendEvent(m_focusObject, &event);
|
||||
|
|
|
|||
Loading…
Reference in New Issue