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:
amer cerkic 2019-07-03 16:02:56 -07:00
parent e429b7a1e2
commit 9384c5b3a3

View file

@ -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();