iOS: return correct uiview for IM rectangles
UITextView has a property for specifying which UIView the CGRects you return should be aligned with. This makes a difference for widgets when not using alien, since then the view that draws the text will usually not be the same as the view that backs the top level QWindow. Change-Id: I240d63c98544c39308cd91465ee84351e7d7d1f4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>bb10
parent
865ef95107
commit
577909b59a
|
|
@ -336,6 +336,18 @@ Q_GLOBAL_STATIC(StaticVariables, staticVariables);
|
|||
return t - f;
|
||||
}
|
||||
|
||||
- (UIView *)textInputView
|
||||
{
|
||||
// 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.
|
||||
QPlatformWindow *topLevel = m_qioswindow;
|
||||
while (QPlatformWindow *p = topLevel->parent())
|
||||
topLevel = p;
|
||||
return reinterpret_cast<UIView *>(topLevel->winId());
|
||||
}
|
||||
|
||||
- (CGRect)firstRectForRange:(UITextRange *)range
|
||||
{
|
||||
QObject *focusObject = QGuiApplication::focusObject();
|
||||
|
|
|
|||
Loading…
Reference in New Issue