QWindowPrivate::setFocusToTarget: Add focusReason parameter
The focusReason is also important when setting focus to the target, so
ammend 8c44064f62 and add this parameter
to the virtual method.
Change-Id: Id7800a366cbc1ce2ac26b3fec1e47ec9267a57bb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
parent
c0c66a42ce
commit
0678a8a00d
|
|
@ -84,7 +84,7 @@ public:
|
|||
Next,
|
||||
Prev
|
||||
};
|
||||
virtual void setFocusToTarget(QWindowPrivate::FocusTarget) {}
|
||||
virtual void setFocusToTarget(FocusTarget, Qt::FocusReason) {}
|
||||
|
||||
virtual QRectF closestAcceptableGeometry(const QRectF &rect) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public:
|
|||
widget->focusWidget()->clearFocus();
|
||||
}
|
||||
|
||||
void setFocusToTarget(QWindowPrivate::FocusTarget target) override
|
||||
void setFocusToTarget(FocusTarget target, Qt::FocusReason reason) override
|
||||
{
|
||||
Q_Q(QWidgetWindow);
|
||||
QWidget *widget = q->widget();
|
||||
|
|
@ -107,7 +107,7 @@ public:
|
|||
}
|
||||
|
||||
if (newFocusWidget)
|
||||
newFocusWidget->setFocus();
|
||||
newFocusWidget->setFocus(reason);
|
||||
}
|
||||
|
||||
QRectF closestAcceptableGeometry(const QRectF &rect) const override;
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ bool QWindowContainer::event(QEvent *e)
|
|||
target = QWindowPrivate::FocusTarget::First;
|
||||
else if (reason == Qt::BacktabFocusReason)
|
||||
target = QWindowPrivate::FocusTarget::Last;
|
||||
qt_window_private(d->window)->setFocusToTarget(target);
|
||||
qt_window_private(d->window)->setFocusToTarget(target, reason);
|
||||
d->window->requestActivate();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue