iOS: don't report selection changed if it didn't change
Be more careful about reporting a new selection to Qt. The code for handling IM selection events in QQuickTextArea is quite complex and need to take pre-edit text into account. The latter means that when the pre-edit text changes, as a result of the user composing a word, the width of the pre-edit text will also change (and as such, the cursor rectangle). But the cursor position itself stays the same. And for this reason, it emits cursorRectChanged more often than strictly needed. But rather than trying to clean that up, we do some extra checking before we send the IM event from QPA in the first place. Pick-to: 6.0 6.1 5.15 Fixes: QTBUG-63018 Change-Id: I689d989c3fe5d61ef2b1dbee7a70418b7790bce9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>bb10
parent
f4887aca1e
commit
be06164201
|
|
@ -640,8 +640,12 @@ static void executeBlockWithoutAnimation(Block block)
|
|||
|
||||
- (void)updateFocalPoint:(QPointF)touchPoint
|
||||
{
|
||||
QPlatformInputContext::setSelectionOnFocusObject(touchPoint, touchPoint);
|
||||
self.focalPoint = touchPoint;
|
||||
|
||||
const int currentCursorPos = QInputMethod::queryFocusObject(Qt::ImCursorPosition, QVariant()).toInt();
|
||||
const int newCursorPos = QPlatformInputContext::queryFocusObject(Qt::ImCursorPosition, touchPoint).toInt();
|
||||
if (newCursorPos != currentCursorPos)
|
||||
QPlatformInputContext::setSelectionOnFocusObject(touchPoint, touchPoint);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Reference in New Issue