mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
testing what happens (for mac specifically) when we specify the focus item to be the root, not NULL as sometimes happens when toggling between modal popups and the main window
This commit is contained in:
parent
e429b7a1e2
commit
9384c5b3a3
1 changed files with 13 additions and 0 deletions
|
@ -4161,6 +4161,19 @@ bool Application::event(QEvent* event) {
|
|||
case QEvent::FocusOut:
|
||||
focusOutEvent(static_cast<QFocusEvent*>(event));
|
||||
return true;
|
||||
case QEvent::FocusIn:
|
||||
{ //testing to see if we can set focus when focus is not set to root window.
|
||||
auto offscreenUi = getOffscreenUI();
|
||||
auto activeFocusItem = offscreenUi->getWindow()->activeFocusItem();
|
||||
|
||||
if (activeFocusItem == NULL) {
|
||||
offscreenUi->getRootItem()->setEnabled(true);
|
||||
offscreenUi->getRootItem()->setFocus(true, Qt::FocusReason::ActiveWindowFocusReason);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
case QEvent::TouchBegin:
|
||||
touchBeginEvent(static_cast<QTouchEvent*>(event));
|
||||
event->accept();
|
||||
|
|
Loading…
Reference in a new issue