diff options
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiosinputcontext.mm | 3 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiostextresponder.mm | 4 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 1 | ||||
-rw-r--r-- | src/plugins/platforms/ios/quiview.mm | 16 |
4 files changed, 19 insertions, 5 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index d2229df133..985eecdb1d 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -667,7 +667,8 @@ void QIOSInputContext::update(Qt::InputMethodQueries updatedProperties) // focus object. We try to detect code paths that fail this assertion and smooth // over the situation by doing a manual update of the focus object. if (qApp->focusObject() != m_imeState.focusObject && updatedProperties != Qt::ImQueryAll) { - qWarning() << "stale focus object" << m_imeState.focusObject << ", doing manual update"; + qWarning() << "stale focus object" << static_cast<void *>(m_imeState.focusObject) + << ", doing manual update"; setFocusObject(qApp->focusObject()); return; } diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index 19e476a064..a7f94dd31f 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -227,13 +227,11 @@ self.keyboardType = UIKeyboardTypeEmailAddress; else if (hints & Qt::ImhDigitsOnly) self.keyboardType = UIKeyboardTypeNumberPad; - else if (hints & Qt::ImhFormattedNumbersOnly) - self.keyboardType = UIKeyboardTypeDecimalPad; else if (hints & Qt::ImhDialableCharactersOnly) self.keyboardType = UIKeyboardTypePhonePad; else if (hints & Qt::ImhLatinOnly) self.keyboardType = UIKeyboardTypeASCIICapable; - else if (hints & Qt::ImhPreferNumbers) + else if (hints & (Qt::ImhPreferNumbers | Qt::ImhFormattedNumbersOnly)) self.keyboardType = UIKeyboardTypeNumbersAndPunctuation; else self.keyboardType = UIKeyboardTypeDefault; diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 1b6a802ca2..864eef3641 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -46,6 +46,7 @@ #include "qiosscreen.h" #include "qiosviewcontroller.h" #include "quiview.h" +#include "qiosinputcontext.h" #include <QtGui/private/qwindow_p.h> #include <qpa/qplatformintegration.h> 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) |