diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-04-07 15:21:56 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-04-07 15:21:56 +0300 |
commit | e89a6f03c4d24f18db36a906a7320035388504ba (patch) | |
tree | 47f7edb9faa26f6f4e2d3f2eea12133933d86e45 /src/plugins/platforms/ios/quiview.mm | |
parent | c8989ca20fa5798f7853f07df6e150cc407c64a4 (diff) | |
parent | 69b8ab23c93785dc69ae43ea04d5620656a4af44 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensource
Change-Id: I3d223d54a832c8365fec4b399550da79f4c1abbb
Diffstat (limited to 'src/plugins/platforms/ios/quiview.mm')
-rw-r--r-- | src/plugins/platforms/ios/quiview.mm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index a4cdedaff7..6ff495ab85 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -45,6 +45,7 @@ #include "qiostextresponder.h" #include "qiosscreen.h" #include "qioswindow.h" +#include "qiosinputcontext.h" #ifndef Q_OS_TVOS #include "qiosmenu.h" #endif @@ -263,7 +264,8 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") - (BOOL)canBecomeFirstResponder { - return !(self.platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus); + return !(self.platformWindow->window()->flags() & (Qt::WindowDoesNotAcceptFocus + | Qt::WindowTransparentForInput)); } - (BOOL)becomeFirstResponder @@ -652,6 +654,18 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") [super addInteraction:interaction]; } +- (UIEditingInteractionConfiguration)editingInteractionConfiguration +{ + // We only want the three-finger-tap edit menu to be available when there's + // actually something to edit. Otherwise the OS will cause a slight delay + // before delivering the release of three finger touch input. Note that we + // do not do any hit testing here to check that the focus object is the one + // being tapped, as the behavior of native iOS apps is to trigger the menu + // regardless of where the gesture is being made. + return QIOSInputContext::instance()->inputMethodAccepted() ? + UIEditingInteractionConfigurationDefault : UIEditingInteractionConfigurationNone; +} + @end @implementation UIView (QtHelpers) |