Fix Qt inputhook

Closes gh-6804