When creating QMouseEvents from scratch, always include globalPos arg.
(Otherwise, Qt creates globalPos from the current value of QCursor::pos(), which isn't the same thing.)