iOS: decouple QIOSWindow and QIOSInputContext
Change-Id: I85dda6fc0c6d2d11709b8bcdc0de6c0cef42d40f Reviewed-by: Lars Knoll <lars.knoll@digia.com>bb10
parent
3d89b10db9
commit
eafa224c3b
|
|
@ -61,11 +61,11 @@ public:
|
|||
void hideInputPanel();
|
||||
bool isInputPanelVisible() const;
|
||||
|
||||
void focusViewChanged(UIView *view);
|
||||
void focusWindowChanged(QWindow *focusWindow);
|
||||
|
||||
private:
|
||||
QIOSKeyboardListener *m_keyboardListener;
|
||||
UIView *m_focusView;
|
||||
UIView<UIKeyInput> *m_focusView;
|
||||
bool m_hasPendingHideRequest;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ QIOSInputContext::QIOSInputContext()
|
|||
, m_focusView(0)
|
||||
, m_hasPendingHideRequest(false)
|
||||
{
|
||||
connect(qGuiApp, &QGuiApplication::focusWindowChanged, this, &QIOSInputContext::focusWindowChanged);
|
||||
}
|
||||
|
||||
QIOSInputContext::~QIOSInputContext()
|
||||
|
|
@ -142,8 +143,9 @@ bool QIOSInputContext::isInputPanelVisible() const
|
|||
return m_keyboardListener->m_keyboardVisible;
|
||||
}
|
||||
|
||||
void QIOSInputContext::focusViewChanged(UIView *view)
|
||||
void QIOSInputContext::focusWindowChanged(QWindow *focusWindow)
|
||||
{
|
||||
UIView<UIKeyInput> *view = reinterpret_cast<UIView<UIKeyInput> *>(focusWindow->handle()->winId());
|
||||
if ([m_focusView isFirstResponder])
|
||||
[view becomeFirstResponder];
|
||||
[m_focusView release];
|
||||
|
|
|
|||
|
|
@ -610,8 +610,6 @@ void QIOSWindow::requestActivateWindow()
|
|||
if (window()->isTopLevel())
|
||||
raise();
|
||||
|
||||
QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
|
||||
static_cast<QIOSInputContext *>(context)->focusViewChanged(m_view);
|
||||
QWindowSystemInterface::handleWindowActivated(window());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue