Answer the question
In order to leave comments, you need to log in
How do I test Drag-and-Drop in Qt?
I have a GUI written in PyQt. It actively uses drag-and-drop from one widget to another (we drag objects from the Item View, drop them onto the Graphics Scene).
I want to test my GUI with QTest.
I write code like this:
QtTest.QTest.mouseMove(self.main_wnd.tree_view.viewport(), constant_rect.center(), 300)
QtTest.QTest.mousePress(self.main_wnd.tree_view.viewport(), QtCore.Qt.LeftButton, QtCore.Qt.KeyboardModifiers(),
constant_rect.center(), 300)
QtTest.QTest.mouseMove(self.main_wnd._scene_views[None].viewport(), QtCore.QPoint(), 300)
QtTest.QTest.mouseRelease(self.main_wnd.tree_view.viewport(), QtCore.Qt.LeftButton, QtCore.Qt.KeyboardModifiers(),
constant_rect.center(), 300)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question