mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-13 04:38:20 +00:00
qt5: let QNitpickerViewWidget react to focus event
With this patch, when calling 'setFocus()' on a QNitpickerViewWidget, the Nitpicker view gets the input focus (provided that the parent Qt window already had it). Fixes #1314
This commit is contained in:
committed by
Christian Helmuth
parent
a9a6e8df89
commit
21154d6866
@ -75,6 +75,7 @@ protected:
|
|||||||
virtual void showEvent(QShowEvent *event);
|
virtual void showEvent(QShowEvent *event);
|
||||||
virtual void hideEvent(QHideEvent *event);
|
virtual void hideEvent(QHideEvent *event);
|
||||||
virtual void paintEvent(QPaintEvent *event);
|
virtual void paintEvent(QPaintEvent *event);
|
||||||
|
virtual void focusInEvent(QFocusEvent * event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -226,3 +226,11 @@ void QNitpickerViewWidget::paintEvent(QPaintEvent *event)
|
|||||||
nitpicker->release_view_handle(neighbor_handle);
|
nitpicker->release_view_handle(neighbor_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QNitpickerViewWidget::focusInEvent(QFocusEvent *)
|
||||||
|
{
|
||||||
|
QNitpickerPlatformWindow *platform_window =
|
||||||
|
dynamic_cast<QNitpickerPlatformWindow*>(window()->windowHandle()->handle());
|
||||||
|
|
||||||
|
platform_window->nitpicker().focus(*nitpicker);
|
||||||
|
}
|
||||||
|
@ -573,6 +573,11 @@ void QNitpickerPlatformWindow::egl_surface(EGLSurface egl_surface)
|
|||||||
_egl_surface = egl_surface;
|
_egl_surface = egl_surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Nitpicker::Session_client &QNitpickerPlatformWindow::nitpicker()
|
||||||
|
{
|
||||||
|
return _nitpicker_session;
|
||||||
|
}
|
||||||
|
|
||||||
Nitpicker::View_capability QNitpickerPlatformWindow::view_cap() const
|
Nitpicker::View_capability QNitpickerPlatformWindow::view_cap() const
|
||||||
{
|
{
|
||||||
QNitpickerPlatformWindow *npw = const_cast<QNitpickerPlatformWindow *>(this);
|
QNitpickerPlatformWindow *npw = const_cast<QNitpickerPlatformWindow *>(this);
|
||||||
|
@ -155,6 +155,7 @@ class QNitpickerPlatformWindow : public QObject, public QPlatformWindow
|
|||||||
|
|
||||||
/* for QNitpickerViewWidget */
|
/* for QNitpickerViewWidget */
|
||||||
|
|
||||||
|
Nitpicker::Session_client &nitpicker();
|
||||||
Nitpicker::View_capability view_cap() const;
|
Nitpicker::View_capability view_cap() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
Reference in New Issue
Block a user