Rebase the previous patch for current Qt
I didn't realize the code is different in upstream a bit and it won't apply