diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-03 06:55:21 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-12-03 06:57:05 +0100 |
commit | e62d04b933a91c2bdd347aa97dc15ba210a04d2a (patch) | |
tree | 67c67af5f59d9b71522738da8a8d2d803e3ff44f /src/plugins/platforms/ios | |
parent | f81f21151d30a37f955aa4af2398a96507626b15 (diff) | |
parent | 9ac156c90b92a981f70929e081c64083b14e9a57 (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
src/corelib/serialization/qcborvalue.cpp
Change-Id: I675a3029955c96e81a33ed9d98b72b55b6784b52
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiostextresponder.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index 396c769be8..1bc9744528 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -781,12 +781,16 @@ - (UIView *)textInputView { + auto *focusWindow = QGuiApplication::focusWindow(); + if (!focusWindow) + return nil; + // iOS expects rects we return from other UITextInput methods // to be relative to the view this method returns. // Since QInputMethod returns rects relative to the top level // QWindow, that is also the view we need to return. - Q_ASSERT(qApp->focusWindow()->handle()); - QPlatformWindow *topLevel = qApp->focusWindow()->handle(); + Q_ASSERT(focusWindow->handle()); + QPlatformWindow *topLevel = focusWindow->handle(); while (QPlatformWindow *p = topLevel->parent()) topLevel = p; return reinterpret_cast<UIView *>(topLevel->winId()); |