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
parent
6a7ee92b39
commit
e79cdd0e6d
|
|
@ -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(); }
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue