QFileDialog::getOpenFileName(parentWidget) always leaves parentWidget de-activated when it returns if native dialogs are used (the default). Keyboard shortcuts do not work and the widget most be manually re-activated by the user.
QColorDialog::getColor does the same.
The same code works as expected on Windows when using the native Win32 dialogs (parentWidget is re-activated).
Workaround is to call parentWidget->activateWindows() explicitly when the function returns.