Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework drag and drop in tests #1056

Merged
merged 29 commits into from
Jul 22, 2024
Merged

Conversation

tov101
Copy link
Contributor

@tov101 tov101 commented Jul 12, 2024

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.

@tov101 tov101 changed the title [WIP] Rework DnD Rework drag and drop in tests Jul 22, 2024
@danielhrisca danielhrisca merged commit cd2557c into danielhrisca:development Jul 22, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants