Qt 5 seems to generate press event when it receives mouse move event while button is being held down. This may cause unwanted button clicks. Looks like this is not always reproducible, so might need to be tried a few times.
- start application A
- start application B
- move window B on top of A
- press and hold mouse button on B window
- move mouse
Or just start 2 instances of B and stack them on top of each other, then press and move and they both close.