summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosinputcontext.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-03-30 15:11:37 +0200
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-04-04 08:46:57 +0000
commit9cb38baaf88b9f50eeed028ab66421c462f3124a (patch)
tree6fce08091bb14bae6ac995d5ed58f36d6810fc25 /src/plugins/platforms/ios/qiosinputcontext.mm
parentce4a759c3dae25b56ec21f98e876b1830c99fa22 (diff)
iOS: check if Qt has an active window before scrolling to cursor
In hybrid applications an external view can be first reponder. And when that is the case, Qt will have no active windows and focusView will return 0. We therefore need to protect scrollToCursor from this case, so it doesn't try to access e.g focusView().window, which will lead to a crash. Task-number: QTBUG-45182 Change-Id: I87d470631f5beda22fd64fc1f2b0f7259344f830 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm')
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index 2ebd87f29c..090df66e0d 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -437,6 +437,9 @@ void QIOSInputContext::scrollToCursor()
if (!rootView)
return;
+ if (!focusView())
+ return;
+
if (rootView.window != focusView().window)
return;