entity, surface inspectors: clear focus widget while showing to keep global shortcuts working

This commit is contained in:
Garux 2023-02-02 19:39:39 +06:00
parent 544ade9bd0
commit a99892751b
2 changed files with 14 additions and 0 deletions

View File

@ -1144,6 +1144,13 @@ protected:
event->accept();
}
}
// clear focus widget while showing to keep global shortcuts working
else if( event->type() == QEvent::Show ) {
QTimer::singleShot( 0, [obj](){
if( static_cast<QWidget*>( obj )->focusWidget() != nullptr )
static_cast<QWidget*>( obj )->focusWidget()->clearFocus();
} );
}
return QObject::eventFilter( obj, event ); // standard event processing
}
}

View File

@ -624,6 +624,13 @@ protected:
return true;
}
}
// clear focus widget while showing to keep global shortcuts working
else if( event->type() == QEvent::Show ) {
QTimer::singleShot( 0, [obj](){
if( static_cast<QWidget*>( obj )->focusWidget() != nullptr )
static_cast<QWidget*>( obj )->focusWidget()->clearFocus();
} );
}
return QObject::eventFilter( obj, event ); // standard event processing
}
}