Qt: Fix OS X build in some unusual circumstances