Seems that in newer versions of PySide, drag and drop operations used for tests are not working anymore.
After some digging in Qt, it seems that exec method from QDrag object is a blocking method for Windows and non-blocking on Linux only if there is no payload (no mime data).
Cloning event that is provided as parameter for drag and drop functionalities is not possible:
If we mock the event and simulate that source method call will return the source widget that we want, it will work only for python implementation
If the Qt original functionalities are used (including when event is forwarded with super), the framework will read the source by it own and will bypass the mock simulation
I could not find any other way to set the source of event.
The proposed implementation use win32api and pyautogui for Windows and Linux platforms and will physically move the mouse cursor.
Note: Even if pyautogui can be used for both platforms Windows and Linux, I choose to use the win32api because it significantly faster.
Timings present in implementation were fine tuned and may impact test results if there are changed.
Seems that in newer versions of
PySide
, drag and drop operations used for tests are not working anymore.After some digging in
Qt
, it seems thatexec
method fromQDrag
object is a blocking method for Windows and non-blocking on Linux only if there is no payload (no mime data).Cloning
event
that is provided as parameter for drag and drop functionalities is not possible:event
and simulate thatsource
method call will return the source widget that we want, it will work only for python implementationevent
is forwarded withsuper
), the framework will read thesource
by it own and will bypass the mock simulationsource
of event.The proposed implementation use
win32api
andpyautogui
for Windows and Linux platforms and will physically move the mouse cursor. Note: Even ifpyautogui
can be used for both platforms Windows and Linux, I choose to use thewin32api
because it significantly faster.Timings present in implementation were fine tuned and may impact test results if there are changed.