From bfd10af24569a7d864d50819e9b004acfee0011b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 21 Apr 2022 15:37:54 +0200 Subject: [PATCH] QIOSTextResponder: restore reset/commit logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After 2211092aa5, parts of the reset/commit logic was left out by a mistake. This patch will add the missing lines back into the text responder. Task-number: QTBUG-102960 Pick-to: 6.3 Change-Id: Ib339eae2af69ce088e251fe8571bed97bbd64fc3 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiostextresponder.h | 2 ++ src/plugins/platforms/ios/qiostextresponder.mm | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/plugins/platforms/ios/qiostextresponder.h b/src/plugins/platforms/ios/qiostextresponder.h index d6f1cfd03f..44068ea87c 100644 --- a/src/plugins/platforms/ios/qiostextresponder.h +++ b/src/plugins/platforms/ios/qiostextresponder.h @@ -63,6 +63,8 @@ QT_END_NAMESPACE - (instancetype)initWithInputContext:(QT_PREPEND_NAMESPACE(QIOSInputContext) *)context; - (BOOL)needsKeyboardReconfigure:(Qt::InputMethodQueries)updatedProperties; +- (void)reset; +- (void)commit; - (void)notifyInputDelegate:(Qt::InputMethodQueries)updatedProperties; diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index deca8c7617..b9a1c016fb 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -490,6 +490,18 @@ return [super needsKeyboardReconfigure:updatedProperties]; } +- (void)reset +{ + [self setMarkedText:@"" selectedRange:NSMakeRange(0, 0)]; + [self notifyInputDelegate:Qt::ImSurroundingText]; +} + +- (void)commit +{ + [self unmarkText]; + [self notifyInputDelegate:Qt::ImSurroundingText]; +} + // ------------------------------------------------------------------------- #ifndef QT_NO_SHORTCUT