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>
This commit is contained in:
parent
ce4a759c3d
commit
9cb38baaf8
@ -437,6 +437,9 @@ void QIOSInputContext::scrollToCursor()
|
||||
if (!rootView)
|
||||
return;
|
||||
|
||||
if (!focusView())
|
||||
return;
|
||||
|
||||
if (rootView.window != focusView().window)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user