| 143 | } |
| 144 | |
| 145 | void TestMapEditor::simulateDrag(const QPoint& start_pos, const QPoint& end_pos) |
| 146 | { |
| 147 | QTest::mousePress(map_widget, Qt::LeftButton, {}, start_pos); |
| 148 | |
| 149 | // NOTE: the implementation of QTest::mouseMove() does not seem to work (tries to set the real cursor position ...) |
| 150 | //QTest::mouseMove(map_widget, end_pos); |
| 151 | // Use manual workaround instead which sends an event directly: |
| 152 | QMouseEvent event(QEvent::MouseMove, end_pos, map_widget->mapToGlobal(end_pos), Qt::NoButton, Qt::LeftButton, Qt::NoModifier); |
| 153 | QApplication::sendEvent(map_widget, &event); |
| 154 | |
| 155 | QTest::mouseRelease(map_widget, Qt::LeftButton, {}, end_pos); |
| 156 | } |
| 157 | |
| 158 | void TestMapEditor::simulateDrag(const QPointF& start_pos, const QPointF& end_pos) |
| 159 | { |