Enable input methods for QQuickWidget

Make it possible for widgets to have non-widget focus objects. Since
we cannot add new virtual functions due to binary compatibility, we
have to do it in QWidgetPrivate.

Task-number: QTBUG-42677
Change-Id: I5f74daed2793c1c149bbe02e54ff2f7e2ad1af9e
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
bb10
Paul Olav Tvete 2014-12-10 15:07:00 +01:00
parent 6a7ee92b39
commit e79cdd0e6d
2 changed files with 8 additions and 0 deletions

View File

@ -619,6 +619,8 @@ public:
QOpenGLContext *shareContext() const;
virtual QObject *focusObject() { return 0; }
#ifndef QT_NO_OPENGL
virtual GLuint textureId() const { return 0; }
virtual QImage grabFramebuffer() { return QImage(); }

View File

@ -147,6 +147,12 @@ QObject *QWidgetWindow::focusObject() const
if (!widget)
widget = m_widget;
if (widget) {
QObject *focusObj = QWidgetPrivate::get(widget)->focusObject();
if (focusObj)
return focusObj;
}
return widget;
}