I've had it with this "feature". I've had a lot of patience with it but... see pull requests #941, #826, #853, #795, #855 and issues #620, #692, #788...
It appears impossible to implement this functionality in Qt without breaking in some OS, or some combination, or breaking something else. And I wasted too much time on it. I've tried four different implementations at least.
If someone has a perfect implementation that works on all OSes and feels like testing it extensively then be my guest and submit a new implementation as pull request.
Please use "Close to tray" instead.