return 0;
}
+/*!
+ Returns the QObject that will be the final receiver of events tied focus, such
+ as key events.
+*/
+QObject *QWindow::focusObject() const
+{
+ return const_cast<QWindow *>(this);
+}
+
void QWindow::showMinimized()
{
void setScreen(QScreen *screen);
virtual QAccessibleInterface *accessibleRoot() const;
+ virtual QObject *focusObject() const;
QPoint mapToGlobal(const QPoint &pos) const;
QPoint mapFromGlobal(const QPoint &pos) const;
return 0;
}
+QObject *QWidgetWindow::focusObject() const
+{
+ QWidget *widget = m_widget->focusWidget();
+
+ if (!widget)
+ widget = m_widget;
+
+ return widget;
+}
+
bool QWidgetWindow::event(QEvent *event)
{
switch (event->type()) {
if (QApplicationPrivate::instance()->modalState() && !qt_try_modal(m_widget, event->type()))
return;
- QWidget *widget = m_widget->focusWidget();
-
- if (!widget)
- widget = m_widget;
+ QObject *receiver = focusObject();
- QGuiApplication::sendSpontaneousEvent(widget, event);
+ QGuiApplication::sendSpontaneousEvent(receiver, event);
}
void QWidgetWindow::updateGeometry()
QWidget *widget() const { return m_widget; }
QAccessibleInterface *accessibleRoot() const;
+ QObject *focusObject() const;
protected:
bool event(QEvent *);