We cannot assume that calling QCursor::setCursor results in a mouse move
event, and we can definitely not assume that the previously pressed
button (via QTest::mousePress) will be included in such an event.
Instead, follow the mechanism used in the QWindow-overload to keep track
of the mouse buttons pressed, and make those the buttons pressed in the
mouse move event we generate.
[ChangeLog][QTestLib] QTest::mouseMove no longer moves the mouse cursor
via QCursor::setPos, but instead generates a QEvent::MouseMove. Testing
of code that relies on QCursor::pos needs to be done with explicit calls
to QCursor::setPos.
Change-Id: Ia643bcc999498a0dc93479b77e107b989dfe202d
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>